CVS commit: [netbsd-5] src/sys/dev/pci

2015-11-09 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Nov  9 12:35:32 UTC 2015

Added Files:
src/sys/dev/pci [netbsd-5]: if_bnxvar.h

Log Message:
Pull up the following revisions(s) (requested by msaitoh in ticket #1983):
sys/dev/pci/pcidevs:revisions 1.1079, 1.1134, 
1.1148-1.1149, 1.1151
sys/dev/pci/pcidevs.h:  regen
sys/dev/pci/pcidevs_data.h: regen
sys/dev/pci/if_bge.c:   revisions 1.183-1.185, 1.187, 
1.189-1.193, 1.195-1.199, 1.202-1.226, 1.228-1.237, 1.240-1.264, 1.267-1.276, 
1.278-1.280, 1.283-1.287 via patch
sys/dev/pci/if_bgereg.h:revisions 1.57-1.74, 1.76-1.90 via patch
sys/dev/pci/if_bgevar.h:revisions 1.6, 1.10-1.13, 1.15-1.17 via 
patch
sys/dev/pci/if_bnx.c:   revisions 1.32, 1.34-1.43, 1.48-1.49, 
1.52
sys/dev/pci/if_bnxreg.h:revisions 1.8, 1.11-1.14
sys/dev/pci/if_bnxvar.h:revisions 1.1-1.3
sys/dev/mii/brgphy.c:   revisions 1.53-1.63, 1.65-69, 1.72-1.74 
via patch
sys/dev/mii/brgphyreg.h:revisions 1.5-1.8
sys/dev/mii/miivar.h:   revisions 1.61
sys/dev/pci/pcireg.h:   patch

Sync bge(4) up to if_bge.c rev. 1.287. Sync brgphy(4) up to 1.74.
Fix some bugs on bnx(4).

Common:
- Add device IDs for Broadcom BCM57710, BCM57711(E), BCM57712(E) and
  BCM57766 (pcidevs only).
- Fix BCM5709 PHY detection.
- Fix detection of BGEPHYF_FIBER_{MII|TBI}
- Add BCM5708S support in brgphy(4).
- Don't use the WIRESPEED function for fiber devices.
bge(4):
- Add some Fujitsu's device support from Michael Moll.
- Add BCM57762 support (PR#46961 from Ryo Onodera).
- Add Altima AC1003, APPLE BCM5701, Broadcom BCM5785F. BCM5785G,
  BCM5787F, BCM5719, BCM5720, BCM57766, BCM57782 and BCM57786.
- Fix DMA setting for read/write on conventional PCI bus devices.
  This bug was added in rev. 1.166.
- Fix printing "discarding oversize frame (len=-4)" message and
  crash by NULL pointer dereferencing.
- The BCM5785 is a PCIe chip but does not report PCIe capabilities.
  Check for this chip explicitely and enable PCIe. Fixes
  'firmware handshake timeout'.
- Allow disabling interrupt mitigation.
- Workaround for BCM5906 silicon bug. When auto-negotiation results
  in half-duplex operation, excess collision on the ethernet link may
  cause internal chip delays that may result in subsequent valid
  frames being dropped due to insufficient receive buffer resources.
  (FreeBSD: r214219, r214251, r214292).
- Allow write DMA to request larger DMA burst size to get better
  performance on BCM5785. (FreeBSD r21: OpenBSD 1.294)
- Enable TX MAC state machine lockup fix for both BCM5755 or higher
  and BCM5906. Publicly available data sheet just says it may happen
  due to corrupted TxMbuf. (FreeBSD r214216)
- Follow Broadcom datasheet:
  Delay 100 microseconds after enabling transmit MAC.
  Delay 10 microseconds after enabling receive MAC. (FreeBSD
  r241220)
- Insert the completion barrier between register write and the
  consecutive delay(). It will fix some device timeout problems we have
  seen before.
- Add DELAY(40) after turning on write DMA state machine.
- Add some workarounds for 5717 A0 and 5776[56] to be stable.
- Check BGE_RXBDFLAG_IPV6 flag for 5717_PLUS case. Note that
  {tcp,udp}6csum flag is currently not added in the capability.
- Add delay after clearing BGE_MACMODE_TBI_SEND_CFGS for the link
  checking.
- Do not touch the jumbo replenish threshold register on chips that do
  not have jumbo support.
- Wait for the bootcode to complete initialization for 5717 and newer
  devices.
- 5718 and 57785 document say we should wait 100us in init.
- Fix a bug that chips which have BCM5906 ASIC touch GPIO wrongly.
- Fix the setting of Tx Random Backoff Register.
- Check the hardware config words and print them.
- Set BGE_MISC_CTL's byte/word swap options before using
  bge_readmem_ind(). Fixes PR#47716.
- For BGE_IS_575X_PLUS() devices, don't set
  BGE_RXLPSTATCONTROL_DACK_FIX bits because these bits are reserved.
- Document says 5717 and newer chips have no
  BGE_PCISTATE_INTR_NOT_ACTIVE bit, so don't use the bit on those
  chips. Same as OpenBSD.
- Fix a bug that the PHY address bits in MI_MODE register is wrongly
  cleard. Set the PHY address correctly.
- Use BGE_SETBIT() instead of CSR_WRITE_4() for the BGE_MISC_LOCAL_CTL
  register to not to modify some GPIO bits.
- Set DMA watermark depend on the PCI max payload size.
- Set BGE_JUMBO_CAPABLE correctly.
- Fix a link detect bug on non-autopoll systems.
- Change the TX ring size for 5717 series and 57764 series.
- Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices.
- For PCI-X BCM5704, set maximum outstanding split transactions to 0.
- Add 40bit DMA bug workaround(BGEF_40BIT_BUG) from FreeBSD.
  This workaround is for 5714/5715 controllers and is not actually a
  MAC controller bug but an issue with the embedded PCIe to PCI-X
  

CVS commit: [netbsd-5] src/sys/dev/pci

2015-11-09 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Nov  9 12:33:51 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.20 -r1.963.4.21 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.20 -r1.962.4.21 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.20 src/sys/dev/pci/pcidevs.h:1.963.4.21
--- src/sys/dev/pci/pcidevs.h:1.963.4.20	Thu Apr 30 20:01:45 2015
+++ src/sys/dev/pci/pcidevs.h	Mon Nov  9 12:33:32 2015
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.20 2015/04/30 20:01:45 snj Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.21 2015/11/09 12:33:32 sborrill Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.20 2015/04/30 20:00:27 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.21 2015/11/09 12:33:02 sborrill Exp
  */
 
 /*
@@ -261,7 +261,8 @@
 #define	PCI_VENDOR_ADVSYS	0x10cd		/* Advanced System Products */
 #define	PCI_VENDOR_RADIUS	0x10ce		/* Radius */
 #define	PCI_VENDOR_CITICORP	0x10cf		/* Citicorp TTI */
-#define	PCI_VENDOR_FUJITSU2	0x10d0		/* Fujitsu Limited (2nd PCI Vendor ID) */
+#define	PCI_VENDOR_FUJITSU4	0x10cf		/* Fujitsu (4th PCI Vendor ID) */
+#define	PCI_VENDOR_FUJITSU2	0x10d0		/* Fujitsu (2nd PCI Vendor ID) */
 #define	PCI_VENDOR_FUTUREPLUS	0x10d1		/* Future+ Systems */
 #define	PCI_VENDOR_MOLEX	0x10d2		/* Molex */
 #define	PCI_VENDOR_JABIL	0x10d3		/* Jabil Circuit */
@@ -885,6 +886,7 @@
 #define	PCI_PRODUCT_ALTIMA_AC1000	0x03e8		/* AC1000 Gigabit Ethernet */
 #define	PCI_PRODUCT_ALTIMA_AC1001	0x03e9		/* AC1001 Gigabit Ethernet */
 #define	PCI_PRODUCT_ALTIMA_AC9100	0x03ea		/* AC9100 Gigabit Ethernet */
+#define	PCI_PRODUCT_ALTIMA_AC1003	0x03eb		/* AC1003 Gigabit Ethernet */
 
 /* AMD products */
 #define	PCI_PRODUCT_AMD_AMD64_HT	0x1100		/* K8 AMD64 HyperTransport configuration */
@@ -1034,6 +1036,7 @@
 #define	PCI_PRODUCT_APPLE_INTREPID2_ATA	0x0069		/* Intrepid 2 ATA */
 #define	PCI_PRODUCT_APPLE_INTREPID2_FW	0x006a		/* Intrepid 2 FireWire */
 #define	PCI_PRODUCT_APPLE_INTREPID2_GMAC	0x006b		/* Intrepid 2 GMAC */
+#define	PCI_PRODUCT_APPLE_BCM5701	0x1645		/* BCM5701 */
 
 /* ARC Logic products */
 #define	PCI_PRODUCT_ARC_1000PV	0xa091		/* 1000PV */
@@ -1426,17 +1429,23 @@
 #define	PCI_PRODUCT_BROADCOM_BCM5706	0x164a		/* BCM5706 NetXtreme II 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5708	0x164c		/* BCM5708 NetXtreme II 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5702FE	0x164d		/* BCM5702FE 10/100 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57710	0x164e		/* BCM57710 NetXtreme II 10Gb Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57711	0x164f		/* BCM57711 NetXtreme II 10Gb Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57711E	0x1650		/* BCM57711E NetXtreme II 10Gb Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5705	0x1653		/* BCM5705 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5705K	0x1654		/* BCM5705K 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5717	0x1655		/* BCM5717 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5718	0x1656		/* BCM5718 10/100/1000 Ethernet */
-#define	PCI_PRODUCT_BROADCOM_BCM5720	0x1658		/* BCM5720 NetXtreme 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5719	0x1657		/* BCM5719 NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5721	0x1659		/* BCM5721 NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5722	0x165a		/* BCM5722 NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5723	0x165b		/* BCM5723 NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5724	0x165c		/* BCM5724 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5705M	0x165d		/* BCM5705M 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5705M_ALT	0x165e		/* BCM5705M 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5720	0x165f		/* BCM5720 NetXtreme 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57712	0x1662		/* BCM57712 NetXtreme II 10Gb Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57712E	0x1663		/* BCM57712E NetXtreme II 10Gb Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5714	0x1668		/* BCM5714 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5714S	0x1669		/* BCM5714S 1000baseSX Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5780	0x166a		/* BCM5780 NetXtreme 1000baseT Ethernet */
@@ -1457,7 +1466,9 @@
 #define	PCI_PRODUCT_BROADCOM_BCM5787F	0x167f		/* BCM5787F 10/100 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5761E	0x1680		/* BCM5761E 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5761	0x1681		/* BCM5761 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57762	0x1682		/* BCM57762 Gigabit Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5764	0x1684		/* BCM5764 NetXtreme 1000baseT 

CVS commit: [netbsd-5] src/sys/dev/mii

2015-11-09 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Nov  9 10:31:26 UTC 2015

Modified Files:
src/sys/dev/mii [netbsd-5]: miidevs.h miidevs_data.h

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.81.4.5 -r1.81.4.6 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.71.4.5 -r1.71.4.6 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.81.4.5 src/sys/dev/mii/miidevs.h:1.81.4.6
--- src/sys/dev/mii/miidevs.h:1.81.4.5	Wed Jun 19 07:51:45 2013
+++ src/sys/dev/mii/miidevs.h	Mon Nov  9 10:31:26 2015
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.81.4.5 2013/06/19 07:51:45 bouyer Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.81.4.6 2015/11/09 10:31:26 sborrill Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.78.4.5 2013/06/19 07:50:15 bouyer Exp
+ *	NetBSD: miidevs,v 1.78.4.6 2015/11/09 10:31:06 sborrill Exp
  */
 
 /*-
@@ -47,7 +47,7 @@
  * mapping; the bit positions are defined in IEEE 802-1990, figure 5.2.
  * (There is a formal 802.3 interpretation, number 1-07/98 of July 09 1998,
  * about this.)
- * The MII_OUI() macro in "mii.h" reflects this.
+ * The MII_OUI() macro in "miivar.h" reflects this.
  * If a vendor uses a different mapping, an "xx" prefixed OUI is defined here
  * which is mangled accordingly to compensate.
  */
@@ -56,12 +56,14 @@
 * Use "make -f Makefile.miidevs" to regenerate miidevs.h and miidevs_data.h
 */
 
+#define	MII_OUI_AGERE	0x00053d	/* Agere */
 #define	MII_OUI_ALTIMA	0x0010a9	/* Altima Communications */
 #define	MII_OUI_AMD	0x1a	/* Advanced Micro Devices */
 #define	MII_OUI_ATHEROS	0x001374	/* Atheros */
 #define	MII_OUI_ATTANSIC	0x00c82e	/* Attansic Technology */
 #define	MII_OUI_BROADCOM	0x001018	/* Broadcom Corporation */
 #define	MII_OUI_BROADCOM2	0x000af7	/* Broadcom Corporation */
+#define	MII_OUI_BROADCOM3	0x001be9	/* Broadcom Corporation */
 #define	MII_OUI_CICADA	0x0003F1	/* Cicada Semiconductor */
 #define	MII_OUI_DAVICOM	0x00606e	/* Davicom Semiconductor */
 #define	MII_OUI_ENABLESEMI	0x0010dd	/* Enable Semiconductor */
@@ -71,13 +73,16 @@
 #define	MII_OUI_JMICRON	0x00d831	/* JMicron */
 #define	MII_OUI_LEVEL1	0x00207b	/* Level 1 */
 #define	MII_OUI_MARVELL	0x005043	/* Marvell Semiconductor */
+#define	MII_OUI_MICREL	0x0010a1	/* Micrel */
 #define	MII_OUI_MYSON	0x00c0b4	/* Myson Technology */
 #define	MII_OUI_NATSEMI	0x080017	/* National Semiconductor */
 #define	MII_OUI_PMCSIERRA	0x00e004	/* PMC-Sierra */
+#define	MII_OUI_RDC	0x00d02d	/* RDC Semiconductor */
 #define	MII_OUI_REALTEK	0x00e04c	/* RealTek */
 #define	MII_OUI_QUALSEMI	0x006051	/* Quality Semiconductor */
 #define	MII_OUI_SEEQ	0x00a07d	/* Seeq */
 #define	MII_OUI_SIS	0x00e006	/* Silicon Integrated Systems */
+#define	MII_OUI_SMSC	0x00800f	/* SMSC */
 #define	MII_OUI_TI	0x080028	/* Texas Instruments */
 #define	MII_OUI_TSC	0x00c039	/* TDK Semiconductor */
 #define	MII_OUI_XAQTI	0x00e0ae	/* XaQti Corp. */
@@ -125,6 +130,16 @@
 #define	MII_STR_ATTANSIC_L1	"L1 10/100/1000 PHY"
 #define	MII_MODEL_ATTANSIC_L2	0x0002
 #define	MII_STR_ATTANSIC_L2	"L2 10/100 PHY"
+#define	MII_MODEL_ATTANSIC_AR8021	0x0004
+#define	MII_STR_ATTANSIC_AR8021	"Atheros AR8021 10/100/1000 PHY"
+#define	MII_MODEL_ATTANSIC_AR8035	0x0007
+#define	MII_STR_ATTANSIC_AR8035	"Atheros AR8035 10/100/1000 PHY"
+
+/*
+ * Agere PHYs
+ */
+#define	MII_MODEL_AGERE_ET1011	0x0004
+#define	MII_STR_AGERE_ET1011	"Agere ET1011 10/100/1000baseT PHY"
 
 /* Altima Communications PHYs */
 /* Don't know the model for ACXXX */
@@ -166,6 +181,8 @@
 #define	MII_STR_xxBROADCOM_BCM5222	"BCM5222 Dual 10/100 media interface"
 #define	MII_MODEL_xxBROADCOM_BCM4401	0x0036
 #define	MII_STR_xxBROADCOM_BCM4401	"BCM4401 10/100 media interface"
+#define	MII_MODEL_xxBROADCOM_BCM5365	0x0037
+#define	MII_STR_xxBROADCOM_BCM5365	"BCM5365 10/100 5-port PHY switch"
 #define	MII_MODEL_BROADCOM_BCM5400	0x0004
 #define	MII_STR_BROADCOM_BCM5400	"BCM5400 1000BASE-T media interface"
 #define	MII_MODEL_BROADCOM_BCM5401	0x0005
@@ -184,6 +201,8 @@
 #define	MII_STR_BROADCOM_BCM5752	"BCM5752 1000BASE-T media interface"
 #define	MII_MODEL_BROADCOM_BCM5701	0x0011
 #define	MII_STR_BROADCOM_BCM5701	"BCM5701 1000BASE-T media interface"
+#define	MII_MODEL_BROADCOM_BCM5706	0x0015
+#define	MII_STR_BROADCOM_BCM5706	"BCM5706 1000BASE-T/SX media interface"
 #define	MII_MODEL_BROADCOM_BCM5703	0x0016
 #define	MII_STR_BROADCOM_BCM5703	"BCM5703 1000BASE-T media interface"
 #define	MII_MODEL_BROADCOM_BCM5750	0x0018
@@ -195,17 +214,29 @@
 #define	MII_MODEL_BROADCOM_BCM54K2	0x002e
 #define	MII_STR_BROADCOM_BCM54K2	"BCM54K2 1000BASE-T media interface"
 #define	MII_MODEL_BROADCOM_BCM5714	0x0034
-#define	MII_STR_BROADCOM_BCM5714	"BCM5714 1000BASE-T media interface"
+#define	MII_STR_BROADCOM_BCM5714	"BCM5714 1000BASE-T/X media interface"
 #define	

CVS commit: [netbsd-5] src/sys/dev/mii

2015-11-09 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Nov  9 10:31:06 UTC 2015

Modified Files:
src/sys/dev/mii [netbsd-5]: miidevs

Log Message:
Pull up the following revisions(s) (requested by msaitoh in ticket #1982):
sys/dev/mii/miidevs:revisions 1.79-1.80, 1.84, 1.86-1.88,
1.91-1.92, 1.94-1.96, 1.98-1.99, 1.101-1.112 via patch

Sync miidevs up to rev. 1.112:
- Add Agere ET1101 (PR#39094)
- Add some CICADA PHYs.
- AddMarvell 88E1000[S], 88E1116R, 88E1118, 88E1145, 88E1149[R],
- 88E1543, 88E3016, PHYG65G
- Add NS DP83849(PR#41256), DP83865.
- Add Broadcom BCM5325, BCM5365, BCM548[12], BCM5706, BCM570[89]S,
- BCM571[79]C, BCM5720C, BCM5756, BCM5785, BCM57765, BCM57780
- Add Atheros AR8021, AR8035
- Add RDC Semiconductor R6040 10/100 integrated PHY
- Add Vitesse VSC8221
- Add SMSC LAN 87[012]0
- Add Intel I21[07].
- Add IC Plus IP100, IP1000A and IP1001
- Add Micrel KSZ9021RN
- Add Relatek RTL8251
- Update comment.


To generate a diff of this commit:
cvs rdiff -u -r1.78.4.5 -r1.78.4.6 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.78.4.5 src/sys/dev/mii/miidevs:1.78.4.6
--- src/sys/dev/mii/miidevs:1.78.4.5	Wed Jun 19 07:50:15 2013
+++ src/sys/dev/mii/miidevs	Mon Nov  9 10:31:06 2015
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.78.4.5 2013/06/19 07:50:15 bouyer Exp $
+$NetBSD: miidevs,v 1.78.4.6 2015/11/09 10:31:06 sborrill Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@ $NetBSD: miidevs,v 1.78.4.5 2013/06/19 0
  * mapping; the bit positions are defined in IEEE 802-1990, figure 5.2.
  * (There is a formal 802.3 interpretation, number 1-07/98 of July 09 1998,
  * about this.)
- * The MII_OUI() macro in "mii.h" reflects this.
+ * The MII_OUI() macro in "miivar.h" reflects this.
  * If a vendor uses a different mapping, an "xx" prefixed OUI is defined here
  * which is mangled accordingly to compensate.
  */
@@ -49,12 +49,14 @@ $NetBSD: miidevs,v 1.78.4.5 2013/06/19 0
 * Use "make -f Makefile.miidevs" to regenerate miidevs.h and miidevs_data.h
 */
 
+oui AGERE			0x00053d	Agere
 oui ALTIMA			0x0010a9	Altima Communications
 oui AMD0x1a	Advanced Micro Devices
 oui ATHEROS			0x001374	Atheros
 oui ATTANSIC			0x00c82e	Attansic Technology
 oui BROADCOM			0x001018	Broadcom Corporation
 oui BROADCOM2			0x000af7	Broadcom Corporation
+oui BROADCOM3			0x001be9	Broadcom Corporation
 oui CICADA			0x0003F1	Cicada Semiconductor
 oui DAVICOM			0x00606e	Davicom Semiconductor
 oui ENABLESEMI			0x0010dd	Enable Semiconductor
@@ -64,13 +66,16 @@ oui INTEL			0x00aa00	Intel
 oui JMICRON			0x00d831	JMicron
 oui LEVEL1			0x00207b	Level 1
 oui MARVELL			0x005043	Marvell Semiconductor
+oui MICREL			0x0010a1	Micrel
 oui MYSON			0x00c0b4	Myson Technology
 oui NATSEMI			0x080017	National Semiconductor
 oui PMCSIERRA			0x00e004	PMC-Sierra
+oui RDC0x00d02d	RDC Semiconductor
 oui REALTEK			0x00e04c	RealTek
 oui QUALSEMI			0x006051	Quality Semiconductor
 oui SEEQ			0x00a07d	Seeq
 oui SIS0x00e006	Silicon Integrated Systems
+oui SMSC			0x00800f	SMSC
 oui TI0x080028	Texas Instruments
 oui TSC0x00c039	TDK Semiconductor
 oui XAQTI			0x00e0ae	XaQti Corp.
@@ -114,6 +119,13 @@ model ATHEROS F2		0x0002 F2 10/100 PHY
 /* Attansic PHYs */
 model ATTANSIC L1		0x0001 L1 10/100/1000 PHY
 model ATTANSIC L2		0x0002 L2 10/100 PHY
+model ATTANSIC AR8021		0x0004 Atheros AR8021 10/100/1000 PHY
+model ATTANSIC AR8035		0x0007 Atheros AR8035 10/100/1000 PHY
+
+/*
+ * Agere PHYs
+ */
+model AGERE ET1011		0x0004 Agere ET1011 10/100/1000baseT PHY
 
 /* Altima Communications PHYs */
 /* Don't know the model for ACXXX */
@@ -139,6 +151,7 @@ model xxBROADCOM BCM5214	0x0028 BCM5214 
 model xxBROADCOM BCM5221	0x001e BCM5221 10/100 media interface
 model xxBROADCOM BCM5222	0x0032 BCM5222 Dual 10/100 media interface
 model xxBROADCOM BCM4401	0x0036 BCM4401 10/100 media interface
+model xxBROADCOM BCM5365	0x0037 BCM5365 10/100 5-port PHY switch
 model BROADCOM BCM5400		0x0004 BCM5400 1000BASE-T media interface
 model BROADCOM BCM5401		0x0005 BCM5401 1000BASE-T media interface
 model BROADCOM BCM5411		0x0007 BCM5411 1000BASE-T media interface
@@ -148,28 +161,45 @@ model BROADCOM BCM5462		0x000d BCM5462 1
 model BROADCOM BCM5421		0x000e BCM5421 1000BASE-T media interface
 model BROADCOM BCM5752		0x0010 BCM5752 1000BASE-T media interface
 model BROADCOM BCM5701		0x0011 BCM5701 1000BASE-T media interface
+model BROADCOM BCM5706		0x0015 BCM5706 1000BASE-T/SX media interface
 model BROADCOM BCM5703		0x0016 BCM5703 1000BASE-T media interface
 model BROADCOM BCM5750		0x0018 BCM5750 1000BASE-T media interface
 model BROADCOM BCM5704		0x0019 BCM5704 1000BASE-T media interface
 model BROADCOM BCM5705		0x001a BCM5705 1000BASE-T media interface
 model BROADCOM BCM54K2		0x002e BCM54K2 1000BASE-T media interface
-model 

CVS commit: [netbsd-5] src/sys/dev/mii

2015-11-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Nov  7 20:35:53 UTC 2015

Modified Files:
src/sys/dev/mii [netbsd-5]: atphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1978):
sys/dev/mii/atphy.c: revision 1.17
Fix incorrect argument of mii_anar(). Fixes PR#50206.
XXX pullup -[567]


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/sys/dev/mii/atphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/mii/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.5.2.2 src/sys/dev/mii/atphy.c:1.5.2.3
--- src/sys/dev/mii/atphy.c:1.5.2.2	Sun May  3 23:45:47 2009
+++ src/sys/dev/mii/atphy.c	Sat Nov  7 20:35:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.5.2.2 2009/05/03 23:45:47 snj Exp $ */
+/*	$NetBSD: atphy.c,v 1.5.2.3 2015/11/07 20:35:52 snj Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.5.2.2 2009/05/03 23:45:47 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.5.2.3 2015/11/07 20:35:52 snj Exp $");
 
 #include 
 #include 
@@ -202,7 +202,7 @@ atphy_service(struct mii_softc *sc, stru
 			return EINVAL;
 		}
 
-		anar = mii_anar(ife->ifm_media);
+		anar = mii_anar(IFM_SUBTYPE(ife->ifm_media));
 		if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) {
 			bmcr |= BMCR_FDX;
 			/* Enable pause. */



CVS commit: [netbsd-5] src/sys/dev/usb

2015-05-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 27 06:18:05 UTC 2015

Modified Files:
src/sys/dev/usb [netbsd-5]: uftdi.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1964):
sys/dev/usb/uftdi.c: revision 1.53
Use as large a packet size as the ftdi endpoint specifies.
Now I can read from my beaglebone!


To generate a diff of this commit:
cvs rdiff -u -r1.39.4.1 -r1.39.4.2 src/sys/dev/usb/uftdi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uftdi.c
diff -u src/sys/dev/usb/uftdi.c:1.39.4.1 src/sys/dev/usb/uftdi.c:1.39.4.2
--- src/sys/dev/usb/uftdi.c:1.39.4.1	Sat Oct 10 20:34:45 2009
+++ src/sys/dev/usb/uftdi.c	Wed May 27 06:18:05 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: uftdi.c,v 1.39.4.1 2009/10/10 20:34:45 sborrill Exp $	*/
+/*	$NetBSD: uftdi.c,v 1.39.4.2 2015/05/27 06:18:05 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uftdi.c,v 1.39.4.1 2009/10/10 20:34:45 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: uftdi.c,v 1.39.4.2 2015/05/27 06:18:05 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -63,12 +63,19 @@ int uftdidebug = 0;
 #define UFTDI_MAX_PORTS		4
 
 /*
- * These are the maximum number of bytes transferred per frame.
- * The output buffer size cannot be increased due to the size encoding.
+ * These are the default number of bytes transferred per frame if the
+ * endpoint doesn't tell us.  The output buffer size is a hard limit
+ * for devices that use a 6-bit size encoding.
  */
 #define UFTDIIBUFSIZE 64
 #define UFTDIOBUFSIZE 64
 
+/*
+ * Magic constants!  Where do these come from?  They're what Linux uses...
+ */
+#define	UFTDI_MAX_IBUFSIZE	512
+#define	UFTDI_MAX_OBUFSIZE	256
+
 struct uftdi_softc {
 	USBBASEDEVICE		sc_dev;		/* base device */
 	usbd_device_handle	sc_udev;	/* device */
@@ -243,6 +250,7 @@ USB_ATTACH(uftdi)
 		sc-sc_iface[idx] = iface;
 
 		uca.bulkin = uca.bulkout = -1;
+		uca.ibufsize = uca.obufsize = 0;
 		for (i = 0; i  id-bNumEndpoints; i++) {
 			int addr, dir, attr;
 			ed = usbd_interface2endpoint_descriptor(iface, i);
@@ -256,11 +264,22 @@ USB_ATTACH(uftdi)
 			addr = ed-bEndpointAddress;
 			dir = UE_GET_DIR(ed-bEndpointAddress);
 			attr = ed-bmAttributes  UE_XFERTYPE;
-			if (dir == UE_DIR_IN  attr == UE_BULK)
+			if (dir == UE_DIR_IN  attr == UE_BULK) {
 uca.bulkin = addr;
-			else if (dir == UE_DIR_OUT  attr == UE_BULK)
+uca.ibufsize = UGETW(ed-wMaxPacketSize);
+if (uca.ibufsize = UFTDI_MAX_IBUFSIZE)
+	uca.ibufsize = UFTDI_MAX_IBUFSIZE;
+			} else if (dir == UE_DIR_OUT  attr == UE_BULK) {
 uca.bulkout = addr;
-			else {
+uca.obufsize = UGETW(ed-wMaxPacketSize)
+- sc-sc_hdrlen;
+if (uca.obufsize = UFTDI_MAX_OBUFSIZE)
+	uca.obufsize = UFTDI_MAX_OBUFSIZE;
+/* Limit length if we have a 6-bit header.  */
+if ((sc-sc_hdrlen  0) 
+(uca.obufsize  UFTDIOBUFSIZE))
+	uca.obufsize = UFTDIOBUFSIZE;
+			} else {
 aprint_error_dev(self,
 unexpected endpoint\n);
 goto bad;
@@ -279,9 +298,11 @@ USB_ATTACH(uftdi)
 
 		uca.portno = FTDI_PIT_SIOA + idx;
 		/* bulkin, bulkout set above */
-		uca.ibufsize = UFTDIIBUFSIZE;
-		uca.obufsize = UFTDIOBUFSIZE - sc-sc_hdrlen;
-		uca.ibufsizepad = UFTDIIBUFSIZE;
+		if (uca.ibufsize == 0)
+			uca.ibufsize = UFTDIIBUFSIZE;
+		uca.ibufsizepad = uca.ibufsize;
+		if (uca.obufsize == 0)
+			uca.obufsize = UFTDIOBUFSIZE - sc-sc_hdrlen;
 		uca.opkthdrlen = sc-sc_hdrlen;
 		uca.device = dev;
 		uca.iface = iface;
@@ -289,7 +310,9 @@ USB_ATTACH(uftdi)
 		uca.arg = sc;
 		uca.info = NULL;
 
-		DPRINTF((uftdi: in=0x%x out=0x%x\n, uca.bulkin, uca.bulkout));
+		DPRINTF((uftdi: in=0x%x out=0x%x isize=0x%x osize=0x%x\n,
+			uca.bulkin, uca.bulkout,
+			uca.ibufsize, uca.obufsize));
 		sc-sc_subdev[idx] = config_found_sm_loc(self, ucombus, NULL,
 		uca, ucomprint, ucomsubmatch);
 	}



CVS commit: [netbsd-5] src/sys/dev/pci

2015-04-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Apr 30 20:00:27 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wm.c if_wmreg.h if_wmvar.h pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1962):
sys/dev/pci/if_wm.c: revisions 1.259-1.266, 1.269, 1.271, 1.273-1.274, 
1.277-1.278, 1.282, 1.284-1.285, 1.287, 1.290, 1.294, 1.297-1.298, 1.300-1.301, 
1.304-1.307, 1.310, 1.312-1.314, 1.316 via patch
sys/dev/pci/if_wmreg.c: revisions 1.54-1.57, 1.59-1.60, 1.62, 1.64-1.66 
via patch
sys/dev/pci/if_wmvar.c: revisions 1.17, 1.20-1.21 via patch
sys/dev/pci/pcidevs: revisions 1.1172, 1.1195, 1.1201 via patch
- Fix MDIC write error bug for 82574 and 82583. For those chips, the
  semaphore must be released after chip reset. Found and tested by
  Mark Davies.
- Fix BMC related bugs.
- Fix yet another NVM bank detect problem in wm(4). Use bank 0 if the detect
  function failed. It's the same as FreeBSD. Observed and tested with
  Asus P8P67 Deluxe motherboard and tested by jnemeth.
- Add support for I354 DH89xxCC and some new I218 devices.
- Fix definition of CTRL_GIO_M_DIS bit.
- Insert completion barrier between register write and delay().
- Bump max TX DMA size to avoid pathological condition with TSO. From dyoung.
- Fix semaphore related bugs.
- Call wm_set_pcie_completion_timeout() on I350, I354, I210 and I211, too.
  Same as FreeBSD and OpenBSD.
- Drop PHPM_GO_LINK_D bit in WMREG_PHPM on some chips. From FreeBSD.
-  Fix fiber link problem (PR#44776 and PR#30880).
- WM_T_82545 is not 1000base-SX but 1000base-LX. Same as FreeBSD.
- Set the WM_F_ATTACHED flag if wm_attach() finished succesfully and check
  the flag in wm_detach(). It will avoid to panic in wm_detach().
  Fixes PR#49102.
- It's not required to print failed to detect NVM bank with
  aprint_error_dev(). Use DPRINTF(). Same as {Free,Open}BSD.
- Fix a bug that the offset of alt MAC address is wrongly calculated to 0
  when alt MAC address function is really used. This bug does not appear
  as real bug if the same MAC address is written in the default location
  and alt MAC address's location.
- Initialize some hardware bits for 8257[1234], 82583, 80003, ICH* and PCH*.
  Some of them are workaround code. From other *BSDs, Linux and documents.
- Fix a bug that wm_sgmii_writereg() function doesn't pass the val argument
  to the I2CCMD register. Reported by Bernard Merindol in PR#49789.
- Delete 82580ER related code. It was from FreeBSD and was removed
  in r203049.
- Remove extra debug message.
- Remove unused variable.
- Remove a duplicated error message.
- Cleanup comments.
- Fix debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.20 -r1.162.4.21 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.24.20.8 -r1.24.20.9 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.2.46.6 -r1.2.46.7 src/sys/dev/pci/if_wmvar.h
cvs rdiff -u -r1.962.4.19 -r1.962.4.20 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.20 src/sys/dev/pci/if_wm.c:1.162.4.21
--- src/sys/dev/pci/if_wm.c:1.162.4.20	Sun Apr 26 09:03:12 2015
+++ src/sys/dev/pci/if_wm.c	Thu Apr 30 20:00:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.20 2015/04/26 09:03:12 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.21 2015/04/30 20:00:26 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.20 2015/04/26 09:03:12 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.21 2015/04/30 20:00:26 snj Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -176,7 +176,7 @@ int	wm_debug = WM_DEBUG_TX | WM_DEBUG_RX
 #define	WM_NEXTTX(sc, x)	(((x) + 1)  WM_NTXDESC_MASK(sc))
 #define	WM_NEXTTXS(sc, x)	(((x) + 1)  WM_TXQUEUELEN_MASK(sc))
 
-#define	WM_MAXTXDMA		round_page(IP_MAXPACKET) /* for TSO */
+#define	WM_MAXTXDMA		 (2 * round_page(IP_MAXPACKET)) /* for TSO */
 
 /*
  * Receive descriptor list size.  We have one Rx buffer for normal
@@ -273,6 +273,7 @@ struct wm_softc {
 	int sc_pcixe_capoff;		/* PCI[Xe] capability register offset */
 
 	const struct wm_product *sc_wmp; /* Pointer to the wm_product entry */
+	uint16_t sc_pcidevid;		/* PCI device ID */
 	wm_chip_type sc_type;		/* MAC type */
 	int sc_rev;			/* MAC revision */
 	wm_phy_type sc_phytype;		/* PHY type */
@@ -285,7 +286,8 @@ struct wm_softc {
 	void *sc_ih;			/* interrupt cookie */
 	callout_t sc_tick_ch;		/* tick callout */
 
-	int sc_ee_addrbits;		/* EEPROM address bits */
+	int sc_nvm_addrbits;		/* NVM address bits */
+	unsigned int sc_nvm_wordsize;		/* NVM word size */
 	int sc_ich8_flash_base;
 	int sc_ich8_flash_bank_size;
 	int sc_nvm_k1_enabled;
@@ -383,8 +385,6 @@ struct wm_softc {
 	int sc_tbi_linkup;		/* TBI link status */
 	int sc_tbi_anegticks;		/* 

CVS commit: [netbsd-5] src/sys/dev/pci

2015-04-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Apr 30 20:02:02 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket 1962


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.19 -r1.963.4.20 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.19 -r1.962.4.20 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.19 src/sys/dev/pci/pcidevs.h:1.963.4.20
--- src/sys/dev/pci/pcidevs.h:1.963.4.19	Sat Sep  7 17:11:18 2013
+++ src/sys/dev/pci/pcidevs.h	Thu Apr 30 20:01:45 2015
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.19 2013/09/07 17:11:18 bouyer Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.20 2015/04/30 20:01:45 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.19 2013/09/07 17:10:18 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.20 2015/04/30 20:00:27 snj Exp
  */
 
 /*
@@ -2145,6 +2145,11 @@
 #define	PCI_PRODUCT_INTEL_SRCZCRX	0x0407		/* RAID controller */
 #define	PCI_PRODUCT_INTEL_SRCU42E	0x0408		/* SCSI RAID controller */
 #define	PCI_PRODUCT_INTEL_SRCS28X	0x0409		/* SATA RAID controller */
+#define	PCI_PRODUCT_INTEL_DH89XXCC_IQIA	0x0434		/* DH89xx CC PCIe Endpoint and QuiskAssit */
+#define	PCI_PRODUCT_INTEL_DH89XXCC_SGMII	0x0438		/* DH89XXCC SGMII */
+#define	PCI_PRODUCT_INTEL_DH89XXCC_SERDES	0x043a		/* DH89XXCC SerDes */
+#define	PCI_PRODUCT_INTEL_DH89XXCC_BPLANE	0x043c		/* DH89XXCC backplane */
+#define	PCI_PRODUCT_INTEL_DH89XXCC_SFP	0x0440		/* DH89XXCC SFP */
 #define	PCI_PRODUCT_INTEL_PCEB	0x0482		/* 82375EB/SB PCI-EISA Bridge */
 #define	PCI_PRODUCT_INTEL_CDC	0x0483		/* 82424ZX Cache and DRAM controller */
 #define	PCI_PRODUCT_INTEL_SIO	0x0484		/* 82378ZB System I/O */
@@ -2331,6 +2336,10 @@
 #define	PCI_PRODUCT_INTEL_I217_V	0x153b		/* I217-V Ethernet Connection */
 #define	PCI_PRODUCT_INTEL_I218_V	0x1559		/* I218-V Ethernet Connection */
 #define	PCI_PRODUCT_INTEL_I218_LM	0x155a		/* I218-LM Ethernet Connection */
+#define	PCI_PRODUCT_INTEL_I218_LM2	0x15a0		/* I218-LM Ethernet Connection */
+#define	PCI_PRODUCT_INTEL_I218_V2	0x15a1		/* I218-V Ethernet Connection */
+#define	PCI_PRODUCT_INTEL_I218_LM3	0x15a2		/* I218-LM Ethernet Connection */
+#define	PCI_PRODUCT_INTEL_I218_V3	0x15a3		/* I218-V Ethernet Connection */
 #define	PCI_PRODUCT_INTEL_80960_RP	0x1960		/* ROB-in i960RP Microprocessor */
 #define	PCI_PRODUCT_INTEL_80960RM_2	0x1962		/* i960 RM PCI-PCI */
 #define	PCI_PRODUCT_INTEL_82840_HB	0x1a21		/* 82840 Host */
@@ -2363,6 +2372,56 @@
 #define	PCI_PRODUCT_INTEL_6SERIES_EHCI_2	0x1c2d		/* 6 Series USB */
 #define	PCI_PRODUCT_INTEL_6SERIES_MEI	0x1c3a		/* 6 Series MEI */
 #define	PCI_PRODUCT_INTEL_6SERIES_KT	0x1c3d		/* 6 Series KT */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_0	0x1f00		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_1	0x1f01		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_2	0x1f02		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_3	0x1f03		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_4	0x1f04		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_5	0x1f05		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_6	0x1f06		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_7	0x1f07		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_8	0x1f08		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_9	0x1f09		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_A	0x1f0a		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_B	0x1f0b		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_C	0x1f0c		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_D	0x1f0d		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_E	0x1f0e		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_TROUTER_F	0x1f0f		/* C2000 Transaction Router */
+#define	PCI_PRODUCT_INTEL_C2000_PCIE_1	0x1f10		/* C2000 PCIe Root Port */
+#define	PCI_PRODUCT_INTEL_C2000_PCIE_2	0x1f11		/* C2000 PCIe Root Port */
+#define	PCI_PRODUCT_INTEL_C2000_PCIE_3	0x1f12		/* C2000 PCIe Root Port */
+#define	PCI_PRODUCT_INTEL_C2000_PCIE_4	0x1f13		/* C2000 PCIe Root Port */
+#define	PCI_PRODUCT_INTEL_C2000_RAS	0x1f14		/* C2000 RAS */
+#define	PCI_PRODUCT_INTEL_C2000_SMBUS	0x1f15		/* C2000 SMBus 2.0 */
+#define	PCI_PRODUCT_INTEL_C2000_RCEC	0x1f16		/* C2000 RCEC */
+#define	PCI_PRODUCT_INTEL_C2000_IQIA_PHYS	0x1f18		/* C2000 IQIA Physical Function */
+#define	PCI_PRODUCT_INTEL_C2000_IQIA	0x1f19		/* C2000 IQIA */
+#define	PCI_PRODUCT_INTEL_C2000_SATA2	0x1f22		/* C2000 SATA2 */
+#define	PCI_PRODUCT_INTEL_C2000_USB	0x1f2c		/* 

CVS commit: [netbsd-5] src/sys/dev/pci

2015-04-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 26 09:03:12 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wm.c

Log Message:
Apply patch, requested by msaitoh in ticket #1961:

sys/dev/pci/if_wm.c:(patch)

 Fix a bug (in the backport for #1850) that passed the wrong pointer as the
first argument of bpf_mtap() on 82575 and newer chip.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.19 -r1.162.4.20 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.19 src/sys/dev/pci/if_wm.c:1.162.4.20
--- src/sys/dev/pci/if_wm.c:1.162.4.19	Sat Sep  7 17:10:18 2013
+++ src/sys/dev/pci/if_wm.c	Sun Apr 26 09:03:12 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.19 2013/09/07 17:10:18 bouyer Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.20 2015/04/26 09:03:12 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.19 2013/09/07 17:10:18 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.20 2015/04/26 09:03:12 martin Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -3304,7 +3304,7 @@ wm_nq_start(struct ifnet *ifp)
 #if NBPFILTER  0
 		/* Pass the packet to any BPF listeners. */
 		if (ifp-if_bpf)
-			bpf_mtap(ifp, m0);
+			bpf_mtap(ifp-if_bpf, m0);
 #endif
 	}
 



CVS commit: [netbsd-5] src/sys/dev/usb

2015-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 11 15:39:33 UTC 2015

Modified Files:
src/sys/dev/usb [netbsd-5]: usbdi.c

Log Message:
Pull up following revision(s) (requested by aymeric in ticket #1948):
sys/dev/usb/usbdi.c: revision 1.163
clip xfer-actlen also in the !DIAGNOSTIC case


To generate a diff of this commit:
cvs rdiff -u -r1.124.4.2 -r1.124.4.3 src/sys/dev/usb/usbdi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.124.4.2 src/sys/dev/usb/usbdi.c:1.124.4.3
--- src/sys/dev/usb/usbdi.c:1.124.4.2	Wed Jan 27 20:56:45 2010
+++ src/sys/dev/usb/usbdi.c	Wed Feb 11 15:39:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.124.4.2 2010/01/27 20:56:45 sborrill Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.124.4.3 2015/02/11 15:39:33 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usbdi.c,v 1.124.4.2 2010/01/27 20:56:45 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: usbdi.c,v 1.124.4.3 2015/02/11 15:39:33 martin Exp $);
 
 #include opt_compat_netbsd.h
 
@@ -773,13 +773,13 @@ usb_transfer_complete(usbd_xfer_handle x
 
 	if (!(xfer-flags  USBD_NO_COPY)  xfer-actlen != 0 
 	usbd_xfer_isread(xfer)) {
-#ifdef DIAGNOSTIC
 		if (xfer-actlen  xfer-length) {
+#ifdef DIAGNOSTIC
 			printf(usb_transfer_complete: actlen  len %d  %d\n,
 			   xfer-actlen, xfer-length);
+#endif
 			xfer-actlen = xfer-length;
 		}
-#endif
 		memcpy(xfer-buffer, KERNADDR(dmap, 0), xfer-actlen);
 	}
 



CVS commit: [netbsd-5] src/sys/dev

2015-02-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Feb  4 04:31:41 UTC 2015

Modified Files:
src/sys/dev [netbsd-5]: vnd.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1946):
sys/dev/vnd.c: revision 1.240, 1.241 via patch
As discussed in
http://mail-index.netbsd.org/tech-kern/2015/01/24/msg018339.html
don't bump v_numoutput if we need to vn_lock() the vnode before queuing
the corresponding I/O, because this may deadlock with genfs_do_putpages()
when called with the vnode locked (as can happen with fsync(2)).
Instead bump is just before the last VOP_STRATEGY(), or before calling
nestiobuf_done().
Thanks to Taylor R Campbell for review.
--
Fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.187.4.6 -r1.187.4.7 src/sys/dev/vnd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.187.4.6 src/sys/dev/vnd.c:1.187.4.7
--- src/sys/dev/vnd.c:1.187.4.6	Wed Aug 22 20:29:20 2012
+++ src/sys/dev/vnd.c	Wed Feb  4 04:31:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.187.4.6 2012/08/22 20:29:20 bouyer Exp $	*/
+/*	$NetBSD: vnd.c,v 1.187.4.7 2015/02/04 04:31:41 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.187.4.6 2012/08/22 20:29:20 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.187.4.7 2015/02/04 04:31:41 snj Exp $);
 
 #if defined(_KERNEL_OPT)
 #include fs_nfs.h
@@ -794,16 +794,10 @@ handle_with_strategy(struct vnd_softc *v
 	size_t resid, sz;
 	off_t bn, offset;
 	struct vnode *vp;
+	struct buf *nbp = NULL;
 
 	flags = obp-b_flags;
 
-	if (!(flags  B_READ)) {
-		vp = bp-b_vp;
-		mutex_enter(vp-v_interlock);
-		vp-v_numoutput++;
-		mutex_exit(vp-v_interlock);
-	}
-
 	/* convert to a byte offset within the file. */
 	bn = obp-b_rawblkno * vnd-sc_dkdev.dk_label-d_secsize;
 
@@ -819,9 +813,8 @@ handle_with_strategy(struct vnd_softc *v
 	 */
 	error = 0;
 	bp-b_resid = bp-b_bcount;
-	for (offset = 0, resid = bp-b_resid; resid;
+	for (offset = 0, resid = bp-b_resid; /* true */;
 	resid -= sz, offset += sz) {
-		struct buf *nbp;
 		daddr_t nbn;
 		int off, nra;
 
@@ -874,10 +867,34 @@ handle_with_strategy(struct vnd_softc *v
 			nbp-vb_buf.b_flags, nbp-vb_buf.b_data,
 			nbp-vb_buf.b_bcount);
 #endif
+		if (resid == sz) {
+			break;
+		}
 		VOP_STRATEGY(vp, nbp);
 		bn += sz;
 	}
-	nestiobuf_done(bp, skipped, error);
+	if (!(flags  B_READ)) {
+		struct vnode *w_vp;
+		/*
+		 * this is the last nested buf, account for
+		 * the parent buf write too.
+		 * This has to be done last, so that
+		 * fsync won't wait for this write which
+		 * has no chance to complete before all nested bufs
+		 * have been queued. But it has to be done
+		 * before the last VOP_STRATEGY() 
+		 * or the call to nestiobuf_done().
+		 */
+		w_vp = bp-b_vp;
+		mutex_enter(w_vp-v_interlock);
+		w_vp-v_numoutput++;
+		mutex_exit(w_vp-v_interlock);
+	}
+	KASSERT(skipped != 0 || nbp != NULL);
+	if (skipped) 
+		nestiobuf_done(bp, skipped, error);
+	else 
+		VOP_STRATEGY(vp, nbp);
 }
 
 static void



CVS commit: [netbsd-5] src/sys/dev/ic

2014-12-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Dec 21 20:49:43 UTC 2014

Modified Files:
src/sys/dev/ic [netbsd-5]: rtl8169.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1936):
sys/dev/ic/rtl8169.c: revision 1.142
RealTek 8139C+ incorrectly identifies UDP checksum 0x as bad.
Force software recalculation of UDP checksum if bad checksum is
reported by the hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.105.4.9 -r1.105.4.10 src/sys/dev/ic/rtl8169.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/rtl8169.c
diff -u src/sys/dev/ic/rtl8169.c:1.105.4.9 src/sys/dev/ic/rtl8169.c:1.105.4.10
--- src/sys/dev/ic/rtl8169.c:1.105.4.9	Wed Jan 25 18:02:44 2012
+++ src/sys/dev/ic/rtl8169.c	Sun Dec 21 20:49:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtl8169.c,v 1.105.4.9 2012/01/25 18:02:44 riz Exp $	*/
+/*	$NetBSD: rtl8169.c,v 1.105.4.10 2014/12/21 20:49:43 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtl8169.c,v 1.105.4.9 2012/01/25 18:02:44 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtl8169.c,v 1.105.4.10 2014/12/21 20:49:43 msaitoh Exp $);
 /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
 
 /*
@@ -1276,9 +1276,19 @@ re_rxeof(struct rtk_softc *sc)
 		M_CSUM_TCP_UDP_BAD;
 } else if (RE_UDPPKT(rxstat)) {
 	m-m_pkthdr.csum_flags |= M_CSUM_UDPv4;
-	if (rxstat  RE_RDESC_STAT_UDPSUMBAD)
-		m-m_pkthdr.csum_flags |=
-		M_CSUM_TCP_UDP_BAD;
+	if (rxstat  RE_RDESC_STAT_UDPSUMBAD) {
+		/*
+		 * XXX: 8139C+ thinks UDP csum
+		 * 0x is bad, force software
+		 * calculation.
+		 */
+		if (sc-sc_quirk  RTKQ_8139CPLUS)
+			m-m_pkthdr.csum_flags
+			= ~M_CSUM_UDPv4;
+		else
+			m-m_pkthdr.csum_flags
+			|= M_CSUM_TCP_UDP_BAD;
+	}
 }
 			}
 		} else {



CVS commit: [netbsd-5] src/sys/dev/raidframe

2014-11-20 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Nov 20 09:38:56 UTC 2014

Modified Files:
src/sys/dev/raidframe [netbsd-5]: raidframevar.h rf_netbsdkintf.c
rf_reconstruct.c

Log Message:
Pull up the following revisions(s) (requested by oster in ticket #1933):
sys/dev/raidframe/raidframevar.h:   revision 1.17
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.316
sys/dev/raidframe/rf_reconstruct.c: revision 1.121 via patch

Fix a long-standing bug related to rebooting while a reconstruct-to-spare
is underway but not yet complete. Fixes PR kern/49244.


To generate a diff of this commit:
cvs rdiff -u -r1.12.10.3 -r1.12.10.4 src/sys/dev/raidframe/raidframevar.h
cvs rdiff -u -r1.250.4.13 -r1.250.4.14 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.105.4.6 -r1.105.4.7 src/sys/dev/raidframe/rf_reconstruct.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/raidframevar.h
diff -u src/sys/dev/raidframe/raidframevar.h:1.12.10.3 src/sys/dev/raidframe/raidframevar.h:1.12.10.4
--- src/sys/dev/raidframe/raidframevar.h:1.12.10.3	Wed Jun 13 14:00:49 2012
+++ src/sys/dev/raidframe/raidframevar.h	Thu Nov 20 09:38:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: raidframevar.h,v 1.12.10.3 2012/06/13 14:00:49 sborrill Exp $ */
+/*	$NetBSD: raidframevar.h,v 1.12.10.4 2014/11/20 09:38:56 sborrill Exp $ */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -384,17 +384,17 @@ struct RF_SparetWait_s {
  * IF YOU ADD A STATE, CHECK TO SEE IF YOU NEED TO MODIFY RF_DEAD_DISK().
  */
 enum RF_DiskStatus_e {
-rf_ds_optimal,  /* no problems */
-rf_ds_failed,   /* reconstruction ongoing */
-rf_ds_reconstructing,   /* reconstruction complete to spare, dead disk
- * not yet replaced */
-rf_ds_dist_spared,  /* reconstruction complete to distributed
+	rf_ds_optimal,  /* no problems */
+	rf_ds_failed,   /* disk has failed */
+	rf_ds_reconstructing,   /* reconstruction ongoing */
+	rf_ds_dist_spared,  /* reconstruction complete to distributed
  * spare space, dead disk not yet replaced */
-rf_ds_spared,   /* reconstruction complete to distributed
- * spare space, dead disk not yet replaced */
-rf_ds_spare,/* an available spare disk */
-rf_ds_used_spare/* a spare which has been used, and hence is
+	rf_ds_spared,   /* reconstruction complete, dead disk not 
+   yet replaced */
+	rf_ds_spare,/* an available spare disk */
+	rf_ds_used_spare,   /* a spare which has been used, and hence is
  * not available */
+	rf_ds_rebuilding_spare	/* a spare which is being rebuilt to */
 };
 typedef enum RF_DiskStatus_e RF_DiskStatus_t;
 

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.13 src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.14
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.13	Wed Oct 24 03:03:53 2012
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Thu Nov 20 09:38:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.13 2012/10/24 03:03:53 riz Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.14 2014/11/20 09:38:56 sborrill Exp $	*/
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -139,7 +139,7 @@
  ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.13 2012/10/24 03:03:53 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.14 2014/11/20 09:38:56 sborrill Exp $);
 
 #include sys/param.h
 #include sys/errno.h
@@ -1466,6 +1466,10 @@ raidioctl(dev_t dev, u_long cmd, void *d
 		}
 		for (j = d_cfg-cols, i = 0; i  d_cfg-nspares; i++, j++) {
 			d_cfg-spares[i] = raidPtr-Disks[j];
+			if (d_cfg-spares[i].status == rf_ds_rebuilding_spare) {
+/* XXX: raidctl(8) expects to see this as a used spare */
+d_cfg-spares[i].status = rf_ds_used_spare;
+			}
 		}
 		retcode = copyout(d_cfg, *ucfgp, sizeof(RF_DeviceConfig_t));
 		RF_Free(d_cfg, sizeof(RF_DeviceConfig_t));

Index: src/sys/dev/raidframe/rf_reconstruct.c
diff -u src/sys/dev/raidframe/rf_reconstruct.c:1.105.4.6 src/sys/dev/raidframe/rf_reconstruct.c:1.105.4.7
--- src/sys/dev/raidframe/rf_reconstruct.c:1.105.4.6	Wed Jun 13 14:00:49 2012
+++ src/sys/dev/raidframe/rf_reconstruct.c	Thu Nov 20 09:38:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_reconstruct.c,v 1.105.4.6 2012/06/13 14:00:49 sborrill Exp $	*/
+/*	$NetBSD: rf_reconstruct.c,v 1.105.4.7 2014/11/20 09:38:56 sborrill Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  

CVS commit: [netbsd-5] src/sys/dev/pci

2014-08-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug 27 06:14:06 UTC 2014

Modified Files:
src/sys/dev/pci [netbsd-5]: pci_usrreq.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1922):
sys/dev/pci/pci_usrreq.c1.26 via patch

Fix to make pci(4) reject unaligned configuration register reads and writes
before feeding them to a kassert in pci_conf_read/write or to a trap in the
hardware itself.


To generate a diff of this commit:
cvs rdiff -u -r1.16.6.3 -r1.16.6.4 src/sys/dev/pci/pci_usrreq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pci_usrreq.c
diff -u src/sys/dev/pci/pci_usrreq.c:1.16.6.3 src/sys/dev/pci/pci_usrreq.c:1.16.6.4
--- src/sys/dev/pci/pci_usrreq.c:1.16.6.3	Tue Sep 15 06:48:49 2009
+++ src/sys/dev/pci/pci_usrreq.c	Wed Aug 27 06:14:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_usrreq.c,v 1.16.6.3 2009/09/15 06:48:49 snj Exp $	*/
+/*	$NetBSD: pci_usrreq.c,v 1.16.6.4 2014/08/27 06:14:05 msaitoh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_usrreq.c,v 1.16.6.3 2009/09/15 06:48:49 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_usrreq.c,v 1.16.6.4 2014/08/27 06:14:05 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -83,7 +83,7 @@ pciioctl(dev_t dev, u_long cmd, void *da
 	case PCI_IOC_BDF_CFGREAD:
 	case PCI_IOC_BDF_CFGWRITE:
 		if (bdfr-bus  255 || bdfr-device = sc-sc_maxndevs ||
-		bdfr-function  7)
+		bdfr-function  7 || ISSET(bdfr-cfgreg.reg, 3))
 			return (EINVAL);
 		tag = pci_make_tag(sc-sc_pc, bdfr-bus, bdfr-device,
 		bdfr-function);



CVS commit: [netbsd-5] src/sys/dev

2014-08-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  8 06:50:12 UTC 2014

Modified Files:
src/sys/dev/pckbport [netbsd-5]: wskbdmap_mfii.c
src/sys/dev/usb [netbsd-5]: ukbdmap.c

Log Message:
Pull up following revision(s) (requested by mbalmer in ticket #1915):
sys/dev/usb/ukbdmap.c: revision 1.29
sys/dev/pckbport/wskbdmap_mfii.c: revision 1.25
Add a belgian keyboard layout, based on the french keyboard layout.
Fixes PR install/46871.


To generate a diff of this commit:
cvs rdiff -u -r1.15.8.5 -r1.15.8.6 src/sys/dev/pckbport/wskbdmap_mfii.c
cvs rdiff -u -r1.20.8.2 -r1.20.8.3 src/sys/dev/usb/ukbdmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pckbport/wskbdmap_mfii.c
diff -u src/sys/dev/pckbport/wskbdmap_mfii.c:1.15.8.5 src/sys/dev/pckbport/wskbdmap_mfii.c:1.15.8.6
--- src/sys/dev/pckbport/wskbdmap_mfii.c:1.15.8.5	Sun Nov 15 06:03:59 2009
+++ src/sys/dev/pckbport/wskbdmap_mfii.c	Fri Aug  8 06:50:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: wskbdmap_mfii.c,v 1.15.8.5 2009/11/15 06:03:59 snj Exp $	*/
+/*	$NetBSD: wskbdmap_mfii.c,v 1.15.8.6 2014/08/08 06:50:12 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.15.8.5 2009/11/15 06:03:59 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: wskbdmap_mfii.c,v 1.15.8.6 2014/08/08 06:50:12 msaitoh Exp $);
 
 #include opt_wskbdmap.h
 #include sys/types.h
@@ -364,6 +364,28 @@ static const keysym_t pckbd_keydesc_fr[]
 KC(184), KS_Mode_switch,	KS_Multi_key,
 };
 
+static const keysym_t pckbd_keydesc_be[] = {
+/*  pos	 normal		shifted		altgr		shift-altgr */
+KC(2),   KS_ampersand,	KS_1,		KS_bar,
+KC(3),   KS_eacute,		KS_2,		KS_at,
+KC(5),   KS_apostrophe,	KS_4,
+KC(6),   KS_parenleft,	KS_5,
+KC(7),   KS_section,	KS_6,		KS_asciicircum,
+KC(8),   KS_egrave,		KS_7,
+KC(9),   KS_exclam,		KS_8,
+KC(10),  KS_ccedilla,	KS_9,		KS_braceleft,
+KC(11),  KS_agrave,		KS_0,		KS_braceright,
+KC(12),  KS_parenright,	KS_degree,
+KC(13),  KS_minus,		KS_underscore,
+KC(26),  KS_dead_circumflex, KS_dead_diaeresis,	KS_bracketleft,
+KC(27),  KS_dollar,		KS_asterisk,	KS_bracketright,
+KC(43),  KS_mu,		KS_sterling,	KS_grave,
+KC(40),  KS_ugrave,		KS_percent,	KS_acute,
+KC(41),  KS_twosuperior,	KS_threesuperior,
+KC(53),  KS_equal,		KS_plus,	KS_asciitilde,
+KC(86),  KS_less,		KS_greater,	KS_backslash,
+};
+
 static const keysym_t pckbd_keydesc_it[] = {
 /*  pos  normal		shifted		altgr		shift-altgr */
 KC(3),   KS_2,		KS_quotedbl,	KS_twosuperior,
@@ -694,6 +716,7 @@ const struct wscons_keydesc pckbd_keydes
 	KBD_MAP(KB_SF,			KB_SG,	pckbd_keydesc_sf),
 	KBD_MAP(KB_SF | KB_NODEAD,	KB_SF,	pckbd_keydesc_sg_nodead),
 	KBD_MAP(KB_FR,  KB_US,  pckbd_keydesc_fr),
+	KBD_MAP(KB_BE,  KB_FR,  pckbd_keydesc_be),
 	KBD_MAP(KB_DK,			KB_US,	pckbd_keydesc_dk),
 	KBD_MAP(KB_DK | KB_NODEAD,	KB_DK,	pckbd_keydesc_dk_nodead),
 	KBD_MAP(KB_IT,			KB_US,	pckbd_keydesc_it),

Index: src/sys/dev/usb/ukbdmap.c
diff -u src/sys/dev/usb/ukbdmap.c:1.20.8.2 src/sys/dev/usb/ukbdmap.c:1.20.8.3
--- src/sys/dev/usb/ukbdmap.c:1.20.8.2	Sun Nov 21 02:38:07 2010
+++ src/sys/dev/usb/ukbdmap.c	Fri Aug  8 06:50:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ukbdmap.c,v 1.20.8.2 2010/11/21 02:38:07 riz Exp $	*/
+/*	$NetBSD: ukbdmap.c,v 1.20.8.3 2014/08/08 06:50:12 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1999,2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ukbdmap.c,v 1.20.8.2 2010/11/21 02:38:07 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: ukbdmap.c,v 1.20.8.3 2014/08/08 06:50:12 msaitoh Exp $);
 
 #include sys/types.h
 #include dev/wscons/wsksymdef.h
@@ -415,6 +415,28 @@ Static const keysym_t ukbd_keydesc_fr[] 
 KC(230), KS_Mode_switch,	KS_Multi_key,
 };
 
+Static const keysym_t ukbd_keydesc_be[] = {
+/*  pos	 normal		shifted		altgr		shift-altgr */
+KC(30),  KS_ampersand,	KS_1,		KS_bar,
+KC(31),  KS_eacute,		KS_2,		KS_at,
+KC(33),  KS_apostrophe,	KS_4,
+KC(34),  KS_parenleft,	KS_5,
+KC(35),  KS_section,	KS_6,		KS_asciicircum,
+KC(36),  KS_egrave,		KS_7,
+KC(37),  KS_exclam,		KS_8,
+KC(38),  KS_ccedilla,	KS_9,		KS_braceleft,
+KC(39),  KS_agrave,		KS_0,		KS_braceright,
+KC(45),  KS_parenright,	KS_degree,
+KC(46),  KS_minus,		KS_underscore,
+KC(47),  KS_dead_circumflex, KS_dead_diaeresis,	KS_bracketleft,
+KC(48),  KS_dollar,		KS_asterisk,	KS_bracketright,
+KC(50),  KS_mu,		KS_sterling,	KS_grave,
+KC(52),  KS_ugrave,		KS_percent,	KS_acute,
+KC(53),  KS_twosuperior,	KS_threesuperior,
+KC(56),  KS_equal,		KS_plus,	KS_asciitilde,
+KC(100), KS_less,		KS_greater,	KS_backslash,
+};
+
 Static const keysym_t ukbd_keydesc_it[] = {
 /*  pos  normal		

CVS commit: [netbsd-5] src/sys/dev/pci

2013-09-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Sep  7 17:10:18 UTC 2013

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wm.c if_wmreg.h if_wmvar.h pcidevs

Log Message:
sys/dev/pci/if_wm.c 1.246-1.247, 1.249-1.258
sys/dev/pci/if_wmreg.h  1.51, 1.53
sys/dev/pci/if_wmvar.h  1.15-1.16
sys/dev/pci/pcidevs 1.1152-1.1153
sys/dev/pci/pcidevs.h   regen
sys/dev/pci/pcidevs_data.h  regen

Add I21[0178] support.
Fix a bug that wm_attach() may fail on some PCH2 or newer system.
wm_valid_nvm_bank_detect_ich8lan() misunderstood the NVM's bank
number. Fixes PR#47878.
Fix a bug that the check of reset complete fails on Intel 8 series
with wm_lan_init_done: lan_init_done failed to complete message.
The broken code was used for ICH8, 9... and PCH2.
The wm_linkintr_gmii() function is called from interrupt. That's
not tick, so call mii_pollstat() instead of mii_tick().
Add ECC support for the packet buffer. Only 82571 and I21[78] support
ECC.
Fix a bug that wrong semaphore is used in wm_gmii_hv_{read,write}reg.
Add comments, fix some comments, use macros and remove trailing
whitespaces.
[msaitoh, ticket #1867]


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.18 -r1.162.4.19 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.24.20.7 -r1.24.20.8 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.2.46.5 -r1.2.46.6 src/sys/dev/pci/if_wmvar.h
cvs rdiff -u -r1.962.4.18 -r1.962.4.19 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.18 src/sys/dev/pci/if_wm.c:1.162.4.19
--- src/sys/dev/pci/if_wm.c:1.162.4.18	Wed Jun 19 07:50:15 2013
+++ src/sys/dev/pci/if_wm.c	Sat Sep  7 17:10:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.18 2013/06/19 07:50:15 bouyer Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.19 2013/09/07 17:10:18 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -37,32 +37,32 @@
 
 /***
 
-  Copyright (c) 2001-2005, Intel Corporation 
+  Copyright (c) 2001-2005, Intel Corporation
   All rights reserved.
-  
-  Redistribution and use in source and binary forms, with or without 
+ 
+  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, 
+ 
+   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 
+ 
+   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 
+ 
+   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) 
+  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 

CVS commit: [netbsd-5] src/sys/dev/pci

2013-09-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Sep  7 17:11:30 UTC 2013

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket 1867


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.18 -r1.963.4.19 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.18 -r1.962.4.19 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.18 src/sys/dev/pci/pcidevs.h:1.963.4.19
--- src/sys/dev/pci/pcidevs.h:1.963.4.18	Wed Jun 19 07:50:54 2013
+++ src/sys/dev/pci/pcidevs.h	Sat Sep  7 17:11:18 2013
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.18 2013/06/19 07:50:54 bouyer Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.19 2013/09/07 17:11:18 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.18 2013/06/19 07:50:15 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.19 2013/09/07 17:10:18 bouyer Exp
  */
 
 /*
@@ -2320,6 +2320,17 @@
 #define	PCI_PRODUCT_INTEL_I350_SGMII	0x1524		/* I350 Gigabit Connection */
 #define	PCI_PRODUCT_INTEL_82801J_D_BM_V	0x1525		/* 82567V LAN Controller */
 #define	PCI_PRODUCT_INTEL_82580_QUAD_FIBER	0x1527		/* 82580 quad-1000BaseX Ethernet */
+#define	PCI_PRODUCT_INTEL_I210_T1	0x1533		/* I210-T1 Ethernet Server Adapter */
+#define	PCI_PRODUCT_INTEL_I210_COPPER_OEM1	0x1534		/* I210 Ethernet (COPPER OEM) */
+#define	PCI_PRODUCT_INTEL_I210_COPPER_IT	0x1535		/* I210 Ethernet (COPPER IT) */
+#define	PCI_PRODUCT_INTEL_I210_FIBER	0x1536		/* I210 Ethernet (FIBER) */
+#define	PCI_PRODUCT_INTEL_I210_SERDES	0x1537		/* I210 Ethernet (SERDES) */
+#define	PCI_PRODUCT_INTEL_I210_SGMII	0x1538		/* I210 Ethernet (SGMII) */
+#define	PCI_PRODUCT_INTEL_I211_COPPER	0x1539		/* I211 Ethernet (COPPER) */
+#define	PCI_PRODUCT_INTEL_I217_LM	0x153a		/* I217-LM Ethernet Connection */
+#define	PCI_PRODUCT_INTEL_I217_V	0x153b		/* I217-V Ethernet Connection */
+#define	PCI_PRODUCT_INTEL_I218_V	0x1559		/* I218-V Ethernet Connection */
+#define	PCI_PRODUCT_INTEL_I218_LM	0x155a		/* I218-LM Ethernet Connection */
 #define	PCI_PRODUCT_INTEL_80960_RP	0x1960		/* ROB-in i960RP Microprocessor */
 #define	PCI_PRODUCT_INTEL_80960RM_2	0x1962		/* i960 RM PCI-PCI */
 #define	PCI_PRODUCT_INTEL_82840_HB	0x1a21		/* 82840 Host */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.18 src/sys/dev/pci/pcidevs_data.h:1.962.4.19
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.18	Wed Jun 19 07:50:54 2013
+++ src/sys/dev/pci/pcidevs_data.h	Sat Sep  7 17:11:18 2013
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.18 2013/06/19 07:50:54 bouyer Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.19 2013/09/07 17:11:18 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.18 2013/06/19 07:50:15 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.19 2013/09/07 17:10:18 bouyer Exp
  */
 
 /*
@@ -8108,6 +8108,50 @@ static const struct pci_product pci_prod
 	82580 quad-1000BaseX Ethernet,
 	},
 	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_T1,
+	I210-T1 Ethernet Server Adapter,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_COPPER_OEM1,
+	I210 Ethernet (COPPER OEM),
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_COPPER_IT,
+	I210 Ethernet (COPPER IT),
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_FIBER,
+	I210 Ethernet (FIBER),
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_SERDES,
+	I210 Ethernet (SERDES),
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I210_SGMII,
+	I210 Ethernet (SGMII),
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I211_COPPER,
+	I211 Ethernet (COPPER),
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I217_LM,
+	I217-LM Ethernet Connection,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I217_V,
+	I217-V Ethernet Connection,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I218_V,
+	I218-V Ethernet Connection,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I218_LM,
+	I218-LM Ethernet Connection,
+	},
+	{
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_80960_RP,
 	ROB-in i960RP Microprocessor,
 	},
@@ -15120,4 +15164,4 @@ static const struct pci_product pci_prod
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3179;
+const int pci_nproducts = 3190;



CVS commit: [netbsd-5] src/sys/dev/pci

2013-06-19 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Jun 19 07:51:06 UTC 2013

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket #1850


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.17 -r1.963.4.18 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.17 -r1.962.4.18 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.17 src/sys/dev/pci/pcidevs.h:1.963.4.18
--- src/sys/dev/pci/pcidevs.h:1.963.4.17	Sun Jan 20 12:20:36 2013
+++ src/sys/dev/pci/pcidevs.h	Wed Jun 19 07:50:54 2013
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.17 2013/01/20 12:20:36 bouyer Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.18 2013/06/19 07:50:54 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.17 2013/01/20 12:19:06 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.18 2013/06/19 07:50:15 bouyer Exp
  */
 
 /*
@@ -2301,8 +2301,10 @@
 #define	PCI_PRODUCT_INTEL_82870P2_IOxAPIC	0x1461		/* 82870P2 P64H2 IOxAPIC */
 #define	PCI_PRODUCT_INTEL_82870P2_HPLUG	0x1462		/* 82870P2 P64H2 Hot Plug Controller */
 #define	PCI_PRODUCT_INTEL_82801I_82567V_3	0x1501		/* i82567V-3 LAN Controller */
-#define	PCI_PRODUCT_INTEL_82583V	0x150c		/* i82583V 1000baseT Ethernet */
+#define	PCI_PRODUCT_INTEL_PCH2_LV_LM	0x1502		/* 82579LM Gigabit Network Connection */
+#define	PCI_PRODUCT_INTEL_PCH2_LV_V	0x1503		/* 82579V Gigabit Network Connection */
 #define	PCI_PRODUCT_INTEL_82576_NS	0x150a		/* 82576 gigabit Ethernet */
+#define	PCI_PRODUCT_INTEL_82583V	0x150c		/* i82583V 1000baseT Ethernet */
 #define	PCI_PRODUCT_INTEL_82576_SERDES_QUAD	0x150d		/* 82576 quad-gigabit Ethernet (SERDES) */
 #define	PCI_PRODUCT_INTEL_82580_COPPER	0x150e		/* 82580 1000BaseT Ethernet */
 #define	PCI_PRODUCT_INTEL_82580_FIBER	0x150f		/* 82580 1000BaseX Ethernet */
@@ -2312,6 +2314,12 @@
 #define	PCI_PRODUCT_INTEL_82576_NS_SERDES	0x1518		/* 82576 gigabit Ethernet (SERDES) */
 #define	PCI_PRODUCT_INTEL_82580_ER	0x151d		/* 82580 1000BaseT Ethernet */
 #define	PCI_PRODUCT_INTEL_82580_ER_DUAL	0x151e		/* 82580 dual-1000BaseT Ethernet */
+#define	PCI_PRODUCT_INTEL_I350_COPPER	0x1521		/* I350 Gigabit Network Connection */
+#define	PCI_PRODUCT_INTEL_I350_FIBER	0x1522		/* I350 Gigabit Fiber Network Connection */
+#define	PCI_PRODUCT_INTEL_I350_SERDES	0x1523		/* I350 Gigabit Backplane Connection */
+#define	PCI_PRODUCT_INTEL_I350_SGMII	0x1524		/* I350 Gigabit Connection */
+#define	PCI_PRODUCT_INTEL_82801J_D_BM_V	0x1525		/* 82567V LAN Controller */
+#define	PCI_PRODUCT_INTEL_82580_QUAD_FIBER	0x1527		/* 82580 quad-1000BaseX Ethernet */
 #define	PCI_PRODUCT_INTEL_80960_RP	0x1960		/* ROB-in i960RP Microprocessor */
 #define	PCI_PRODUCT_INTEL_80960RM_2	0x1962		/* i960 RM PCI-PCI */
 #define	PCI_PRODUCT_INTEL_82840_HB	0x1a21		/* 82840 Host */
@@ -2769,6 +2777,7 @@
 #define	PCI_PRODUCT_INTEL_21152	0xb152		/* S21152BB PCI-PCI Bridge */
 #define	PCI_PRODUCT_INTEL_21154	0xb154		/* S21152BA,S21154AE/BE PCI-PCI Bridge */
 #define	PCI_PRODUCT_INTEL_21555	0xb555		/* 21555 Non-Transparent PCI-PCI Bridge */
+#define	PCI_PRODUCT_INTEL_HANKSVILLE	0xF0FE		/* HANKSVILLE LAN Controller */
 
 /* Intergraph products */
 #define	PCI_PRODUCT_INTERGRAPH_4D50T	0x00e4		/* Powerstorm 4D50T */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.17 src/sys/dev/pci/pcidevs_data.h:1.962.4.18
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.17	Sun Jan 20 12:20:38 2013
+++ src/sys/dev/pci/pcidevs_data.h	Wed Jun 19 07:50:54 2013
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.17 2013/01/20 12:20:38 bouyer Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.18 2013/06/19 07:50:54 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.17 2013/01/20 12:19:06 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.18 2013/06/19 07:50:15 bouyer Exp
  */
 
 /*
@@ -8032,14 +8032,22 @@ static const struct pci_product pci_prod
 	i82567V-3 LAN Controller,
 	},
 	{
-	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82583V,
-	i82583V 1000baseT Ethernet,
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PCH2_LV_LM,
+	82579LM Gigabit Network Connection,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PCH2_LV_V,
+	82579V Gigabit Network Connection,
 	},
 	{
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82576_NS,
 	82576 gigabit Ethernet,
 	},
 	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82583V,
+	i82583V 1000baseT Ethernet,
+	},
+	{
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82576_SERDES_QUAD,
 	82576 quad-gigabit Ethernet (SERDES),
 	},
@@ -8076,6 +8084,30 @@ static const struct pci_product pci_prod
 	82580 dual-1000BaseT Ethernet,
 	},
 	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I350_COPPER,
+	I350 Gigabit 

CVS commit: [netbsd-5] src/sys/dev/mii

2013-06-19 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Jun 19 07:51:45 UTC 2013

Modified Files:
src/sys/dev/mii [netbsd-5]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #1850


To generate a diff of this commit:
cvs rdiff -u -r1.81.4.4 -r1.81.4.5 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.71.4.4 -r1.71.4.5 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.81.4.4 src/sys/dev/mii/miidevs.h:1.81.4.5
--- src/sys/dev/mii/miidevs.h:1.81.4.4	Fri Nov 19 23:59:22 2010
+++ src/sys/dev/mii/miidevs.h	Wed Jun 19 07:51:45 2013
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.81.4.4 2010/11/19 23:59:22 riz Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.81.4.5 2013/06/19 07:51:45 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.78.4.4 2010/11/19 23:58:41 riz Exp
+ *	NetBSD: miidevs,v 1.78.4.5 2013/06/19 07:50:15 bouyer Exp
  */
 
 /*-
@@ -267,6 +267,10 @@
 #define	MII_STR_yyINTEL_I82553	i82553 10/100 media interface
 #define	MII_MODEL_yyINTEL_I82566	0x0039
 #define	MII_STR_yyINTEL_I82566	i82566 10/100/1000 media interface
+#define	MII_MODEL_INTEL_I82577	0x0005
+#define	MII_STR_INTEL_I82577	i82577 10/100/1000 media interface
+#define	MII_MODEL_INTEL_I82579	0x0009
+#define	MII_STR_INTEL_I82579	i82579 10/100/1000 media interface
 #define	MII_MODEL_xxMARVELL_I82563	0x000a
 #define	MII_STR_xxMARVELL_I82563	i82563 10/100/1000 media interface
 

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.71.4.4 src/sys/dev/mii/miidevs_data.h:1.71.4.5
--- src/sys/dev/mii/miidevs_data.h:1.71.4.4	Fri Nov 19 23:59:22 2010
+++ src/sys/dev/mii/miidevs_data.h	Wed Jun 19 07:51:45 2013
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.71.4.4 2010/11/19 23:59:22 riz Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.71.4.5 2013/06/19 07:51:45 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.78.4.4 2010/11/19 23:58:41 riz Exp
+ *	NetBSD: miidevs,v 1.78.4.5 2013/06/19 07:50:15 bouyer Exp
  */
 
 /*-
@@ -102,6 +102,8 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82562ET, MII_STR_yyINTEL_I82562ET },
  { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82553, MII_STR_yyINTEL_I82553 },
  { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82566, MII_STR_yyINTEL_I82566 },
+ { MII_OUI_INTEL, MII_MODEL_INTEL_I82577, MII_STR_INTEL_I82577 },
+ { MII_OUI_INTEL, MII_MODEL_INTEL_I82579, MII_STR_INTEL_I82579 },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_I82563, MII_STR_xxMARVELL_I82563 },
  { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_IGP01E1000, MII_STR_yyINTEL_IGP01E1000 },
  { MII_OUI_JMICRON, MII_MODEL_JMICRON_JMC250, MII_STR_JMICRON_JMC250 },



CVS commit: [netbsd-5] src/sys/dev

2013-06-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Jun  9 11:29:43 UTC 2013

Modified Files:
src/sys/dev [netbsd-5]: fss.c

Log Message:
Pull up following revision(s) (requested by gdt in ticket #1853):
sys/dev/fss.c: revision 1.84
Take fss_device_lock first when closing a fss device.
Fixes PR kern/47514 (Multiple dump -X triggers kernel panic in fss_ioctl)


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.6 -r1.60.4.7 src/sys/dev/fss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/fss.c
diff -u src/sys/dev/fss.c:1.60.4.6 src/sys/dev/fss.c:1.60.4.7
--- src/sys/dev/fss.c:1.60.4.6	Thu Aug 23 08:59:47 2012
+++ src/sys/dev/fss.c	Sun Jun  9 11:29:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fss.c,v 1.60.4.6 2012/08/23 08:59:47 bouyer Exp $	*/
+/*	$NetBSD: fss.c,v 1.60.4.7 2013/06/09 11:29:43 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.60.4.6 2012/08/23 08:59:47 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.60.4.7 2013/06/09 11:29:43 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -221,11 +221,13 @@ fss_close(dev_t dev, int flags, int mode
 	mflag = (mode == S_IFCHR ? FSS_CDEV_OPEN : FSS_BDEV_OPEN);
 	error = 0;
 
+	mutex_enter(fss_device_lock);
 restart:
 	mutex_enter(sc-sc_slock);
 	if ((sc-sc_flags  (FSS_CDEV_OPEN|FSS_BDEV_OPEN)) != mflag) {
 		sc-sc_flags = ~mflag;
 		mutex_exit(sc-sc_slock);
+		mutex_exit(fss_device_lock);
 		return 0;
 	}
 	if ((sc-sc_flags  FSS_ACTIVE) != 0 
@@ -237,12 +239,9 @@ restart:
 	}
 	if ((sc-sc_flags  FSS_ACTIVE) != 0) {
 		mutex_exit(sc-sc_slock);
+		mutex_exit(fss_device_lock);
 		return error;
 	}
-	if (! mutex_tryenter(fss_device_lock)) {
-		mutex_exit(sc-sc_slock);
-		goto restart;
-	}
 
 	KASSERT((sc-sc_flags  FSS_ACTIVE) == 0);
 	KASSERT((sc-sc_flags  (FSS_CDEV_OPEN|FSS_BDEV_OPEN)) == mflag);



CVS commit: [netbsd-5] src/sys/dev/pci

2013-06-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Jun  9 11:51:40 UTC 2013

Modified Files:
src/sys/dev/pci [netbsd-5]: if_vioif.c

Log Message:
Pull up following revision(s) (requested by minoura in ticket #1861):
sys/dev/pci/if_vioif.c: revision 1.4
Fix a typo, and remove an unused member.
This should fix the problem that recent Qemu dies during configuring a vioif.
Fixes PR#47780.


To generate a diff of this commit:
cvs rdiff -u -r1.2.6.2 -r1.2.6.3 src/sys/dev/pci/if_vioif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.2.6.2 src/sys/dev/pci/if_vioif.c:1.2.6.3
--- src/sys/dev/pci/if_vioif.c:1.2.6.2	Wed Jan 25 21:18:15 2012
+++ src/sys/dev/pci/if_vioif.c	Sun Jun  9 11:51:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.2.6.2 2012/01/25 21:18:15 riz Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.2.6.3 2013/06/09 11:51:40 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_vioif.c,v 1.2.6.2 2012/01/25 21:18:15 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_vioif.c,v 1.2.6.3 2013/06/09 11:51:40 msaitoh Exp $);
 
 #include bpfilter.h
 
@@ -155,7 +155,6 @@ struct vioif_softc {
 
 	uint8_t			sc_mac[ETHER_ADDR_LEN];
 	struct ethercom		sc_ethercom;
-	uint32_t		sc_features;
 	short			sc_ifflags;
 
 	/* bus_dmamem */
@@ -658,7 +657,7 @@ vioif_stop(struct ifnet *ifp, int disabl
 		vioif_rx_drain(sc);
 	
 	virtio_reinit_start(vsc);
-	virtio_negotiate_features(vsc, sc-sc_features);
+	virtio_negotiate_features(vsc, vsc-sc_features);
 	virtio_start_vq_intr(vsc, sc-sc_vq[0]);
 	virtio_stop_vq_intr(vsc, sc-sc_vq[1]);
 	if (vsc-sc_nvqs = 3)



CVS commit: [netbsd-5] src/sys/dev/pci

2013-05-11 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat May 11 22:34:38 UTC 2013

Modified Files:
src/sys/dev/pci [netbsd-5]: pcireg.h ppb.c

Log Message:
Applied patch (requested by msaitoh in ticket #1844):

sys/dev/pci/pcireg.h1.69
sys/dev/pci/ppb.c   1.44-1.45

Support PCI Express 2.0.
Print version and device/port type information
[msaitoh, ticket #1844]


To generate a diff of this commit:
cvs rdiff -u -r1.57.20.1 -r1.57.20.2 src/sys/dev/pci/pcireg.h
cvs rdiff -u -r1.39 -r1.39.10.1 src/sys/dev/pci/ppb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.57.20.1 src/sys/dev/pci/pcireg.h:1.57.20.2
--- src/sys/dev/pci/pcireg.h:1.57.20.1	Fri Nov 19 23:40:28 2010
+++ src/sys/dev/pci/pcireg.h	Sat May 11 22:34:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.57.20.1 2010/11/19 23:40:28 riz Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.57.20.2 2013/05/11 22:34:38 riz Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -540,6 +540,17 @@ typedef u_int8_t pci_revision_t;
  * PCI Express; access via capability pointer.
  */
 #define PCI_PCIE_XCAP		0x00
+#define	PCI_PCIE_XCAP_VER_MASK	0x000f
+#define	 PCI_PCIE_XCAP_VER_1_0		0x0001
+#define	 PCI_PCIE_XCAP_VER_2_0		0x0002
+#define	PCI_PCIE_XCAP_TYPE_MASK	0x00f0
+#define	 PCI_PCIE_XCAP_TYPE_PCIE_DEV	0x
+#define	 PCI_PCIE_XCAP_TYPE_PCI_DEV	0x0010
+#define	 PCI_PCIE_XCAP_TYPE_ROOT	0x0040
+#define	 PCI_PCIE_XCAP_TYPE_UP		0x0050
+#define	 PCI_PCIE_XCAP_TYPE_DOWN	0x0060
+#define	 PCI_PCIE_XCAP_TYPE_PCIE2PCI	0x0070
+#define	 PCI_PCIE_XCAP_TYPE_PCI2PCIE	0x0080
 #define PCI_PCIE_XCAP_SI	0x0100
 #define PCI_PCIE_DCAP		0x04
 #define PCI_PCIE_DCSR		0x08

Index: src/sys/dev/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.39 src/sys/dev/pci/ppb.c:1.39.10.1
--- src/sys/dev/pci/ppb.c:1.39	Sat May  3 05:44:06 2008
+++ src/sys/dev/pci/ppb.c	Sat May 11 22:34:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.39 2008/05/03 05:44:06 cegger Exp $	*/
+/*	$NetBSD: ppb.c,v 1.39.10.1 2013/05/11 22:34:38 riz Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.39 2008/05/03 05:44:06 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.39.10.1 2013/05/11 22:34:38 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -43,6 +43,10 @@ __KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.39
 #include dev/pci/ppbreg.h
 #include dev/pci/pcidevs.h
 
+#define	PCI_PCIE_SLCSR_NOTIFY_MASK	\
+	(PCI_PCIE_SLCSR_ABE | PCI_PCIE_SLCSR_PFE | PCI_PCIE_SLCSR_MSE |	\
+	 PCI_PCIE_SLCSR_PDE | PCI_PCIE_SLCSR_CCE | PCI_PCIE_SLCSR_HPE)
+
 struct ppb_softc {
 	device_t sc_dev;		/* generic device glue */
 	pci_chipset_tag_t sc_pc;	/* our PCI chipset... */
@@ -72,7 +76,7 @@ ppbmatch(device_t parent, cfdata_t match
 }
 
 static void
-ppb_fix_pcix(device_t self)
+ppb_fix_pcie(device_t self)
 {
 	struct ppb_softc *sc = device_private(self);
 	pcireg_t reg;
@@ -82,15 +86,55 @@ ppb_fix_pcix(device_t self)
 off, reg))
 		return; /* Not a PCIe device */
 
-	if ((reg  0x000f) != 0x0001) {
-		aprint_normal_dev(self, unsupported PCI Express version\n);
+	aprint_normal_dev(self, PCI Express );
+	switch (reg  PCI_PCIE_XCAP_VER_MASK) {
+	case PCI_PCIE_XCAP_VER_1_0:
+		aprint_normal(1.0);
+		break;
+	case PCI_PCIE_XCAP_VER_2_0:
+		aprint_normal(2.0);
+		break;
+	default:
+		aprint_normal_dev(self, version unsupported (0x%x)\n,
+		(reg  PCI_PCIE_XCAP_VER_MASK)  16);
 		return;
 	}
-	reg = pci_conf_read(sc-sc_pc, sc-sc_tag, off + 0x18);
-	if (reg  0x003f) {
-		aprint_normal_dev(self, disabling notification events\n);
-		reg = ~0x003f;
-		pci_conf_write(sc-sc_pc, sc-sc_tag, off + 0x18, reg);
+	aprint_normal( );
+	switch (reg  PCI_PCIE_XCAP_TYPE_MASK) {
+	case PCI_PCIE_XCAP_TYPE_PCIE_DEV:
+		aprint_normal(PCI-E Endpoint device);
+		break;
+	case PCI_PCIE_XCAP_TYPE_PCI_DEV:
+		aprint_normal(Legacy PCI-E Endpoint device);
+		break;
+	case PCI_PCIE_XCAP_TYPE_ROOT:
+		aprint_normal(Root Port of PCI-E Root Complex);
+		break;
+	case PCI_PCIE_XCAP_TYPE_UP:
+		aprint_normal(Upstream Port of PCI-E Switch);
+		break;
+	case PCI_PCIE_XCAP_TYPE_DOWN:
+		aprint_normal(Downstream Port of PCI-E Switch);
+		break;
+	case PCI_PCIE_XCAP_TYPE_PCIE2PCI:
+		aprint_normal(PCI-E to PCI/PCI-X Bridge);
+		break;
+	case PCI_PCIE_XCAP_TYPE_PCI2PCIE:
+		aprint_normal(PCI/PCI-X to PCI-E Bridge);
+		break;
+	default:
+		aprint_normal(Device/Port Type 0x%x,
+		(reg  PCI_PCIE_XCAP_TYPE_MASK)  20);
+		break;
+	}
+	aprint_normal(\n);
+
+	reg = pci_conf_read(sc-sc_pc, sc-sc_tag, off + PCI_PCIE_SLCSR);
+	if (reg  PCI_PCIE_SLCSR_NOTIFY_MASK) {
+		aprint_debug_dev(self, disabling notification events\n);
+		reg = ~PCI_PCIE_SLCSR_NOTIFY_MASK;
+		pci_conf_write(sc-sc_pc, sc-sc_tag,
+		

CVS commit: [netbsd-5] src/sys/dev/pci

2013-01-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 20 12:19:07 UTC 2013

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs viaide.c

Log Message:
Apply patch, requested by msaitoh in ticket #1842:
sys/dev/pci/pcidevs 1.969 via patch
sys/dev/pci/viaide.c1.57

Add VT8237S Integrated SATA Controller support.
PR#47452.


To generate a diff of this commit:
cvs rdiff -u -r1.962.4.16 -r1.962.4.17 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.57.4.3 -r1.57.4.4 src/sys/dev/pci/viaide.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.962.4.16 src/sys/dev/pci/pcidevs:1.962.4.17
--- src/sys/dev/pci/pcidevs:1.962.4.16	Sat Mar 17 19:05:38 2012
+++ src/sys/dev/pci/pcidevs	Sun Jan 20 12:19:06 2013
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.16 2012/03/17 19:05:38 bouyer Exp $
+$NetBSD: pcidevs,v 1.962.4.17 2013/01/20 12:19:06 bouyer Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4147,6 +4147,7 @@ product VIATECH VT3351_HB_4351	0x4351	VT
 product VIATECH CX700M2_IDE	0x5324	CX700M2/VX700 IDE Controller
 product VIATECH VT8237A_SATA_2	0x5337	VT8237A Integrated SATA Controller
 product VIATECH VT3351_IOAPIC	0x5351	VT3351 I/O APIC Interrupt Controller
+product VIATECH VT8237S_SATA	0x5372	VT8237S Integrated SATA Controller
 product VIATECH VT86C100A	0x6100	VT86C100A (Rhine-II) 10/100 Ethernet
 product VIATECH VT8378_IG	0x7205	VT8378 KM400 UniChrome Integrated Graphics
 product VIATECH KT880_5		0x7269	KT880 CPU to PCI Bridge

Index: src/sys/dev/pci/viaide.c
diff -u src/sys/dev/pci/viaide.c:1.57.4.3 src/sys/dev/pci/viaide.c:1.57.4.4
--- src/sys/dev/pci/viaide.c:1.57.4.3	Sat Jan  9 01:56:51 2010
+++ src/sys/dev/pci/viaide.c	Sun Jan 20 12:19:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: viaide.c,v 1.57.4.3 2010/01/09 01:56:51 snj Exp $	*/
+/*	$NetBSD: viaide.c,v 1.57.4.4 2013/01/20 12:19:07 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: viaide.c,v 1.57.4.3 2010/01/09 01:56:51 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: viaide.c,v 1.57.4.4 2013/01/20 12:19:07 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -339,6 +339,11 @@ static const struct pciide_product_desc 
 	  VIA Technologies VT8237R SATA Controller,
 	  via_sata_chip_map_0,
 	},
+	{ PCI_PRODUCT_VIATECH_VT8237S_SATA,
+	  0,
+	  VIA Technologies VT8237S SATA Controller,
+	  via_sata_chip_map_7,
+	},
 	{ 0,
 	  0,
 	  NULL,



CVS commit: [netbsd-5] src/sys/dev/pci

2013-01-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 20 12:21:05 UTC 2013

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket #1842


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.16 -r1.963.4.17 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.16 -r1.962.4.17 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.16 src/sys/dev/pci/pcidevs.h:1.963.4.17
--- src/sys/dev/pci/pcidevs.h:1.963.4.16	Sat Mar 17 19:06:21 2012
+++ src/sys/dev/pci/pcidevs.h	Sun Jan 20 12:20:36 2013
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.16 2012/03/17 19:06:21 bouyer Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.17 2013/01/20 12:20:36 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.16 2012/03/17 19:05:38 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.17 2013/01/20 12:19:06 bouyer Exp
  */
 
 /*
@@ -4154,6 +4154,7 @@
 #define	PCI_PRODUCT_VIATECH_CX700M2_IDE	0x5324		/* CX700M2/VX700 IDE Controller */
 #define	PCI_PRODUCT_VIATECH_VT8237A_SATA_2	0x5337		/* VT8237A Integrated SATA Controller */
 #define	PCI_PRODUCT_VIATECH_VT3351_IOAPIC	0x5351		/* VT3351 I/O APIC Interrupt Controller */
+#define	PCI_PRODUCT_VIATECH_VT8237S_SATA	0x5372		/* VT8237S Integrated SATA Controller */
 #define	PCI_PRODUCT_VIATECH_VT86C100A	0x6100		/* VT86C100A (Rhine-II) 10/100 Ethernet */
 #define	PCI_PRODUCT_VIATECH_VT8378_IG	0x7205		/* VT8378 KM400 UniChrome Integrated Graphics */
 #define	PCI_PRODUCT_VIATECH_KT880_5	0x7269		/* KT880 CPU to PCI Bridge */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.16 src/sys/dev/pci/pcidevs_data.h:1.962.4.17
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.16	Sat Mar 17 19:06:21 2012
+++ src/sys/dev/pci/pcidevs_data.h	Sun Jan 20 12:20:38 2013
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.16 2012/03/17 19:06:21 bouyer Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.17 2013/01/20 12:20:38 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.16 2012/03/17 19:05:38 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.17 2013/01/20 12:19:06 bouyer Exp
  */
 
 /*
@@ -14492,6 +14492,10 @@ static const struct pci_product pci_prod
 	VT3351 I/O APIC Interrupt Controller,
 	},
 	{
+	PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8237S_SATA,
+	VT8237S Integrated SATA Controller,
+	},
+	{
 	PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT86C100A,
 	VT86C100A (Rhine-II) 10/100 Ethernet,
 	},
@@ -15080,4 +15084,4 @@ static const struct pci_product pci_prod
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3169;
+const int pci_nproducts = 3170;



CVS commit: [netbsd-5] src/sys/dev

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:12:57 UTC 2013

Modified Files:
src/sys/dev [netbsd-5]: lockstat.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1826):
sys/dev/lockstat.c: revision 1.16
Fix off by one.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.10.1 src/sys/dev/lockstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/lockstat.c
diff -u src/sys/dev/lockstat.c:1.15 src/sys/dev/lockstat.c:1.15.10.1
--- src/sys/dev/lockstat.c:1.15	Mon Apr 28 20:23:46 2008
+++ src/sys/dev/lockstat.c	Sun Jan 13 16:12:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $	*/
+/*	$NetBSD: lockstat.c,v 1.15.10.1 2013/01/13 16:12:56 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15 2008/04/28 20:23:46 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: lockstat.c,v 1.15.10.1 2013/01/13 16:12:56 bouyer Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -270,7 +270,7 @@ lockstat_stop(lsdisable_t *ld)
 
 	cpuno = 0;
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		if (cpuno  sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
+		if (cpuno = sizeof(ld-ld_freq) / sizeof(ld-ld_freq[0])) {
 			log(LOG_WARNING, lockstat: too many CPUs\n);
 			break;
 		}



CVS commit: [netbsd-5] src/sys/dev/raidframe

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:14:43 UTC 2013

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_driver.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1827):
sys/dev/raidframe/rf_driver.c: revision 1.131
Fix off by one read.


To generate a diff of this commit:
cvs rdiff -u -r1.118.10.2 -r1.118.10.3 src/sys/dev/raidframe/rf_driver.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_driver.c
diff -u src/sys/dev/raidframe/rf_driver.c:1.118.10.2 src/sys/dev/raidframe/rf_driver.c:1.118.10.3
--- src/sys/dev/raidframe/rf_driver.c:1.118.10.2	Thu Dec 10 22:59:16 2009
+++ src/sys/dev/raidframe/rf_driver.c	Sun Jan 13 16:14:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_driver.c,v 1.118.10.2 2009/12/10 22:59:16 snj Exp $	*/
+/*	$NetBSD: rf_driver.c,v 1.118.10.3 2013/01/13 16:14:42 bouyer Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.2 2009/12/10 22:59:16 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_driver.c,v 1.118.10.3 2013/01/13 16:14:42 bouyer Exp $);
 
 #include opt_raid_diagnostic.h
 
@@ -868,7 +868,7 @@ rf_ConfigureDebug(RF_Config_t *cfgPtr)
 	int i;
 
 	rf_ResetDebugOptions();
-	for (i = 0; cfgPtr-debugVars[i][0]  i  RF_MAXDBGV; i++) {
+	for (i = 0; i  RF_MAXDBGV  cfgPtr-debugVars[i][0]; i++) {
 		name_p = rf_find_non_white(cfgPtr-debugVars[i][0]);
 		white_p = rf_find_white(name_p);	/* skip to start of 2nd
 			 * word */



CVS commit: [netbsd-5] src/sys/dev/usb

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:28:07 UTC 2013

Modified Files:
src/sys/dev/usb [netbsd-5]: ubsa_common.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1830):
sys/dev/usb/ubsa_common.c: revision 1.9
Fix off by one read error.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.8.1 src/sys/dev/usb/ubsa_common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ubsa_common.c
diff -u src/sys/dev/usb/ubsa_common.c:1.4 src/sys/dev/usb/ubsa_common.c:1.4.8.1
--- src/sys/dev/usb/ubsa_common.c:1.4	Sat May 24 16:40:58 2008
+++ src/sys/dev/usb/ubsa_common.c	Sun Jan 13 16:28:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $	*/
+/*	$NetBSD: ubsa_common.c,v 1.4.8.1 2013/01/13 16:28:07 bouyer Exp $	*/
 /*-
  * Copyright (c) 2002, Alexander Kabaev kan.FreeBSD.org.
  * All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4 2008/05/24 16:40:58 cube Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubsa_common.c,v 1.4.8.1 2013/01/13 16:28:07 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -112,7 +112,7 @@ ubsa_request(struct ubsa_softc *sc, int 
 	else
 		req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
 
-	if (portno  UBSA_MAXCONN) {
+	if (portno = UBSA_MAXCONN) {
 		printf(%s: ubsa_request: invalid port(%d)#\n,
 			USBDEVNAME(sc-sc_dev), portno);
 		return USBD_INVAL; 



CVS commit: [netbsd-5] src/sys/dev/scsipi

2012-10-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 31 15:17:53 UTC 2012

Modified Files:
src/sys/dev/scsipi [netbsd-5]: sd.c

Log Message:
sys/dev/scsipi/sd.c patch

Allow disk strategy to be queried and changed at runtime
for sd(4) disks.
[buhrow, ticket #1807]


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.275.4.1 src/sys/dev/scsipi/sd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.275 src/sys/dev/scsipi/sd.c:1.275.4.1
--- src/sys/dev/scsipi/sd.c:1.275	Wed Jul 16 18:54:09 2008
+++ src/sys/dev/scsipi/sd.c	Wed Oct 31 15:17:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.275 2008/07/16 18:54:09 drochner Exp $	*/
+/*	$NetBSD: sd.c,v 1.275.4.1 2012/10/31 15:17:53 riz Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sd.c,v 1.275 2008/07/16 18:54:09 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: sd.c,v 1.275.4.1 2012/10/31 15:17:53 riz Exp $);
 
 #include opt_scsi.h
 #include rnd.h
@@ -1003,7 +1003,7 @@ sdioctl(dev_t dev, u_long cmd, void *add
 	struct sd_softc *sd = device_lookup_private(sd_cd, SDUNIT(dev));
 	struct scsipi_periph *periph = sd-sc_periph;
 	int part = SDPART(dev);
-	int error = 0;
+	int error = 0, s;
 #ifdef __HAVE_OLD_DISKLABEL
 	struct disklabel *newlabel = NULL;
 #endif
@@ -1027,6 +1027,8 @@ sdioctl(dev_t dev, u_long cmd, void *add
 		case OSCIOCIDENTIFY:
 		case SCIOCCOMMAND:
 		case SCIOCDEBUG:
+		case DIOCGSTRATEGY:
+		case DIOCSSTRATEGY:
 			if (part == RAW_PART)
 break;
 		/* FALLTHROUGH */
@@ -1237,6 +1239,47 @@ sdioctl(dev_t dev, u_long cmd, void *add
 		return (dkwedge_list(sd-sc_dk, dkwl, l));
 	}
 
+	case DIOCGSTRATEGY:
+	{
+		struct disk_strategy *dks = (void *)addr;
+
+		s = splbio();
+		strlcpy(dks-dks_name, bufq_getstrategyname(sd-buf_queue),
+		sizeof(dks-dks_name));
+		splx(s);
+		dks-dks_paramlen = 0;
+
+		return 0;
+	}
+	
+	case DIOCSSTRATEGY:
+	{
+		struct disk_strategy *dks = (void *)addr;
+		struct bufq_state *new;
+		struct bufq_state *old;
+
+		if ((flag  FWRITE) == 0) {
+			return EBADF;
+		}
+		if (dks-dks_param != NULL) {
+			return EINVAL;
+		}
+		dks-dks_name[sizeof(dks-dks_name) - 1] = 0; /* ensure term */
+		error = bufq_alloc(new, dks-dks_name,
+		BUFQ_EXACT|BUFQ_SORT_RAWBLOCK);
+		if (error) {
+			return error;
+		}
+		s = splbio();
+		old = sd-buf_queue;
+		bufq_move(new, old);
+		sd-buf_queue = new;
+		splx(s);
+		bufq_free(old);
+
+		return 0;
+	}
+
 	default:
 		if (part != RAW_PART)
 			return (ENOTTY);



CVS commit: [netbsd-5] src/sys/dev/raidframe

2012-10-23 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 24 03:03:53 UTC 2012

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_netbsdkintf.c

Log Message:
sys/dev/raidframe/rf_netbsdkintf.c  patch

Implement DIOCGSTRATEGY and DIOCSSTRATEGY for raidframe devices.
(The default strategy is not changed)
[buhrow, ticket #1788]


To generate a diff of this commit:
cvs rdiff -u -r1.250.4.12 -r1.250.4.13 src/sys/dev/raidframe/rf_netbsdkintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.12 src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.13
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.12	Wed Jun 13 14:00:49 2012
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Wed Oct 24 03:03:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.12 2012/06/13 14:00:49 sborrill Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.13 2012/10/24 03:03:53 riz Exp $	*/
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -139,7 +139,7 @@
  ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.12 2012/06/13 14:00:49 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.13 2012/10/24 03:03:53 riz Exp $);
 
 #include sys/param.h
 #include sys/errno.h
@@ -973,7 +973,7 @@ raidioctl(dev_t dev, u_long cmd, void *d
 {
 	int unit = raidunit(dev);
 	int error = 0;
-	int part, pmask;
+	int part, pmask, s;
 	struct cfdata *cf;
 	struct raid_softc *rs;
 	RF_Config_t *k_cfg, *u_cfg;
@@ -1026,6 +1026,7 @@ raidioctl(dev_t dev, u_long cmd, void *d
 	case DIOCWLABEL:
 	case DIOCAWEDGE:
 	case DIOCDWEDGE:
+	case DIOCSSTRATEGY:
 		if ((flag  FWRITE) == 0)
 			return (EBADF);
 	}
@@ -1078,6 +1079,8 @@ raidioctl(dev_t dev, u_long cmd, void *d
 	case RAIDFRAME_PARITYMAP_GET_DISABLE:
 	case RAIDFRAME_PARITYMAP_SET_DISABLE:
 	case RAIDFRAME_PARITYMAP_SET_PARAMS:
+	case DIOCGSTRATEGY:
+	case DIOCSSTRATEGY:
 		if ((rs-sc_flags  RAIDF_INITED) == 0)
 			return (ENXIO);
 	}
@@ -1840,6 +1843,45 @@ raidioctl(dev_t dev, u_long cmd, void *d
 		(struct dkwedge_list *)data, l);
 	case DIOCCACHESYNC:
 		return rf_sync_component_caches(raidPtr);
+
+	case DIOCGSTRATEGY:
+	{
+		struct disk_strategy *dks = (void *)data;
+
+		s = splbio();
+		strlcpy(dks-dks_name, bufq_getstrategyname(rs-buf_queue),
+		sizeof(dks-dks_name));
+		splx(s);
+		dks-dks_paramlen = 0;
+
+		return 0;
+	}
+	
+	case DIOCSSTRATEGY:
+	{
+		struct disk_strategy *dks = (void *)data;
+		struct bufq_state *new;
+		struct bufq_state *old;
+
+		if (dks-dks_param != NULL) {
+			return EINVAL;
+		}
+		dks-dks_name[sizeof(dks-dks_name) - 1] = 0; /* ensure term */
+		error = bufq_alloc(new, dks-dks_name,
+		BUFQ_EXACT|BUFQ_SORT_RAWBLOCK);
+		if (error) {
+			return error;
+		}
+		s = splbio();
+		old = rs-buf_queue;
+		bufq_move(new, old);
+		rs-buf_queue = new;
+		splx(s);
+		bufq_free(old);
+
+		return 0;
+	}
+
 	default:
 		retcode = ENOTTY;
 	}



CVS commit: [netbsd-5] src/sys/dev/pci

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:46:37 UTC 2012

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wm.c

Log Message:
Apply patch, requested by msaitoh in ticket 1800:
sys/dev/pci/if_wm.c:revision 1.231 via patch
Add workaround for QEMU and the variants that fail on
EEPROM access.
This problem was discovered a few years ago, but some variants
and cloud services still have the bug. This problem is not
NetBSD's bug but qemus' bug. For NetBSD users, existence of
buggy virtual machines is sad thing, so we add a workaroud.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.16 -r1.162.4.17 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.16 src/sys/dev/pci/if_wm.c:1.162.4.17
--- src/sys/dev/pci/if_wm.c:1.162.4.16	Wed Jan 25 18:02:17 2012
+++ src/sys/dev/pci/if_wm.c	Wed Oct 17 20:46:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.16 2012/01/25 18:02:17 riz Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.17 2012/10/17 20:46:37 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.16 2012/01/25 18:02:17 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.17 2012/10/17 20:46:37 bouyer Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -4362,6 +4362,22 @@ wm_read_eeprom_uwire(struct wm_softc *sc
 		reg = CSR_READ(sc, WMREG_EECD)  ~(EECD_SK | EECD_DI);
 		CSR_WRITE(sc, WMREG_EECD, reg);
 
+		/*
+		 * XXX: workaround for a bug in qemu-0.12.x and prior
+		 * and Xen.
+		 *
+		 * We use this workaround only for 82540 because qemu's
+		 * e1000 act as 82540.
+		 */
+		if (sc-sc_type == WM_T_82540) {
+			reg |= EECD_SK;
+			CSR_WRITE(sc, WMREG_EECD, reg);
+			reg = ~EECD_SK;
+			CSR_WRITE(sc, WMREG_EECD, reg);
+			delay(2);
+		}
+		/* XXX: end of workaround */
+		
 		/* Set CHIP SELECT. */
 		reg |= EECD_CS;
 		CSR_WRITE(sc, WMREG_EECD, reg);



CVS commit: [netbsd-5] src/sys/dev/pci

2012-09-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Sep 30 18:03:43 UTC 2012

Modified Files:
src/sys/dev/pci [netbsd-5]: mfi_pci.c

Log Message:
Pull up following revision(s) (requested by jnemeth in ticket #1795):
sys/dev/pci/mfi_pci.c: revision 1.17 via patch
PR/46877 - Wolfgang Stukenbrock -- missing definition for Symbios SAS 9261-8i


To generate a diff of this commit:
cvs rdiff -u -r1.5.14.1 -r1.5.14.2 src/sys/dev/pci/mfi_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mfi_pci.c
diff -u src/sys/dev/pci/mfi_pci.c:1.5.14.1 src/sys/dev/pci/mfi_pci.c:1.5.14.2
--- src/sys/dev/pci/mfi_pci.c:1.5.14.1	Sun Mar 28 15:03:22 2010
+++ src/sys/dev/pci/mfi_pci.c	Sun Sep 30 18:03:43 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi_pci.c,v 1.5.14.1 2010/03/28 15:03:22 snj Exp $ */
+/* $NetBSD: mfi_pci.c,v 1.5.14.2 2012/09/30 18:03:43 bouyer Exp $ */
 /* $OpenBSD: mfi_pci.c,v 1.11 2006/08/06 04:40:08 brad Exp $ */
 /*
  * Copyright (c) 2006 Marco Peereboom ma...@peereboom.us
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mfi_pci.c,v 1.5.14.1 2010/03/28 15:03:22 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: mfi_pci.c,v 1.5.14.2 2012/09/30 18:03:43 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -78,6 +78,7 @@ static const struct mfi_pci_subtype mfi_
 
 static const struct mfi_pci_subtype mfi_gen2_subtypes[] = {
 	{ PCI_VENDOR_SYMBIOS,	0x9261,		SAS 9260-8i },
+	{ PCI_VENDOR_SYMBIOS,	0x9263,		SAS 9261-8i },
 	{ 0x0,			0,		 }
 };
 



CVS commit: [netbsd-5] src/sys/dev/ic

2012-09-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Sep 15 09:32:36 UTC 2012

Modified Files:
src/sys/dev/ic [netbsd-5]: gem.c gemreg.h gemvar.h

Log Message:
Pull up following revision(s) (requested by jdc in ticket #1789):
sys/dev/ic/gem.c: revision 1.99 via patch
sys/dev/ic/gemvar.h: revision 1.24 via patch
sys/dev/ic/gemreg.h: revision 1.15 via patch
Apply lockup fixes from Havard Eidnes/OpenBSD in PR port-sparc64/46260:
- add an additional watchdog for RX overflow
- re-initialise the chip on device timeout
Also alter the interrupt blanking rate to 8 packets, as per OpenSolaris.


To generate a diff of this commit:
cvs rdiff -u -r1.78.4.2 -r1.78.4.3 src/sys/dev/ic/gem.c
cvs rdiff -u -r1.14 -r1.14.4.1 src/sys/dev/ic/gemreg.h
cvs rdiff -u -r1.18 -r1.18.20.1 src/sys/dev/ic/gemvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/gem.c
diff -u src/sys/dev/ic/gem.c:1.78.4.2 src/sys/dev/ic/gem.c:1.78.4.3
--- src/sys/dev/ic/gem.c:1.78.4.2	Sat Jun 18 16:40:31 2011
+++ src/sys/dev/ic/gem.c	Sat Sep 15 09:32:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gem.c,v 1.78.4.2 2011/06/18 16:40:31 bouyer Exp $ */
+/*	$NetBSD: gem.c,v 1.78.4.3 2012/09/15 09:32:36 bouyer Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.78.4.2 2011/06/18 16:40:31 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.78.4.3 2012/09/15 09:32:36 bouyer Exp $);
 
 #include opt_inet.h
 #include bpfilter.h
@@ -93,6 +93,8 @@ static void	gem_stop(struct ifnet *, int
 int		gem_ioctl(struct ifnet *, u_long, void *);
 void		gem_tick(void *);
 void		gem_watchdog(struct ifnet *);
+void		gem_rx_watchdog(void *);
+void		gem_pcs_start(struct gem_softc *sc);
 void		gem_shutdown(void *);
 void		gem_pcs_start(struct gem_softc *sc);
 void		gem_pcs_stop(struct gem_softc *sc, int);
@@ -504,6 +506,8 @@ gem_attach(sc, enaddr)
 #endif
 
 	callout_init(sc-sc_tick_ch, 0);
+	callout_init(sc-sc_rx_watchdog, 0);
+	callout_setfunc(sc-sc_rx_watchdog, gem_rx_watchdog, sc);
 	return;
 
 	/*
@@ -691,6 +695,8 @@ gem_reset_rx(struct gem_softc *sc)
 	/* Wait till it finishes */
 	if (!gem_bitwait(sc, h, GEM_RX_CONFIG, 1, 0))
 		aprint_error_dev(sc-sc_dev, cannot disable read dma\n);
+	/* Wait 5ms extra. */
+	delay(5000);
 
 	/* Finally, reset the ERX */
 	bus_space_write_4(t, h2, GEM_RESET, GEM_RESET_RX);
@@ -775,7 +781,7 @@ gem_rx_common(struct gem_softc *sc)
 	(3 * sc-sc_rxfifosize / 256) |
 	((sc-sc_rxfifosize / 256)  12));
 	bus_space_write_4(t, h, GEM_RX_BLANKING,
-	(6  GEM_RX_BLANKING_TIME_SHIFT) | 6);
+	(6  GEM_RX_BLANKING_TIME_SHIFT) | 8);
 }
 
 /*
@@ -1762,6 +1768,8 @@ gem_rint(sc)
 		if (gem_add_rxbuf(sc, i) != 0) {
 			GEM_COUNTER_INCR(sc, sc_ev_rxnobuf);
 			ifp-if_ierrors++;
+			aprint_error_dev(sc-sc_dev,
+			receive error: RX no buffer space\n);
 			GEM_INIT_RXDESC(sc, i);
 			bus_dmamap_sync(sc-sc_dmatag, rxs-rxs_dmamap, 0,
 			rxs-rxs_dmamap-dm_mapsize, BUS_DMASYNC_PREREAD);
@@ -2143,12 +2151,20 @@ gem_intr(v)
 		/*
 		 * At least with GEM_SUN_GEM and some GEM_SUN_ERI
 		 * revisions GEM_MAC_RX_OVERFLOW happen often due to a
-		 * silicon bug so handle them silently. Moreover, it's
-		 * likely that the receiver has hung so we reset it.
+		 * silicon bug so handle them silently.  So if we detect
+		 * an RX FIFO overflow, we fire off a timer, and check
+		 * whether we're still making progress by looking at the
+		 * RX FIFO write and read pointers.
 		 */
 		if (rxstat  GEM_MAC_RX_OVERFLOW) {
 			ifp-if_ierrors++;
-			gem_reset_rxdma(sc);
+			aprint_error_dev(sc-sc_dev,
+			receive error: RX overflow sc-rxptr %d, complete %d\n, sc-sc_rxptr, bus_space_read_4(t, h, GEM_RX_COMPLETION));
+			sc-sc_rx_fifo_wr_ptr =
+bus_space_read_4(t, h, GEM_RX_FIFO_WR_PTR);
+			sc-sc_rx_fifo_rd_ptr =
+bus_space_read_4(t, h, GEM_RX_FIFO_RD_PTR);
+			callout_schedule(sc-sc_rx_watchdog, 400);
 		} else if (rxstat  ~(GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT))
 			printf(%s: MAC rx fault, status 0x%02x\n,
 			device_xname(sc-sc_dev), rxstat);
@@ -2177,6 +2193,61 @@ gem_intr(v)
 	return (r);
 }
 
+void
+gem_rx_watchdog(void *arg)
+{
+	struct gem_softc *sc = arg;
+	struct ifnet *ifp = sc-sc_ethercom.ec_if;
+	bus_space_tag_t t = sc-sc_bustag;
+	bus_space_handle_t h = sc-sc_h1;
+	u_int32_t rx_fifo_wr_ptr;
+	u_int32_t rx_fifo_rd_ptr;
+	u_int32_t state;
+
+	if ((ifp-if_flags  IFF_RUNNING) == 0) {
+		aprint_error_dev(sc-sc_dev, receiver not running\n);
+		return;
+	}
+
+	rx_fifo_wr_ptr = bus_space_read_4(t, h, GEM_RX_FIFO_WR_PTR);
+	rx_fifo_rd_ptr = bus_space_read_4(t, h, GEM_RX_FIFO_RD_PTR);
+	state = bus_space_read_4(t, h, GEM_MAC_MAC_STATE);
+	if ((state  GEM_MAC_STATE_OVERFLOW) == GEM_MAC_STATE_OVERFLOW 
+	((rx_fifo_wr_ptr == rx_fifo_rd_ptr) ||
+	 ((sc-sc_rx_fifo_wr_ptr == rx_fifo_wr_ptr) 
+	  (sc-sc_rx_fifo_rd_ptr == rx_fifo_rd_ptr
+	{
+		/*
+		

CVS commit: [netbsd-5] src/sys/dev

2012-08-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Aug 22 20:29:21 UTC 2012

Modified Files:
src/sys/dev [netbsd-5]: vnd.c

Log Message:
Apply patch, requested by buhrow in ticket 1771
sys/dev/vnd.c:  patch
Implement wedge ioctls and wedge autodiscovery for vnd(4)


To generate a diff of this commit:
cvs rdiff -u -r1.187.4.5 -r1.187.4.6 src/sys/dev/vnd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.187.4.5 src/sys/dev/vnd.c:1.187.4.6
--- src/sys/dev/vnd.c:1.187.4.5	Sat Dec 31 22:11:12 2011
+++ src/sys/dev/vnd.c	Wed Aug 22 20:29:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.187.4.5 2011/12/31 22:11:12 snj Exp $	*/
+/*	$NetBSD: vnd.c,v 1.187.4.6 2012/08/22 20:29:20 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.187.4.5 2011/12/31 22:11:12 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.187.4.6 2012/08/22 20:29:20 bouyer Exp $);
 
 #if defined(_KERNEL_OPT)
 #include fs_nfs.h
@@ -253,6 +253,8 @@ extern struct cfdriver vnd_cd;
 static struct vnd_softc	*vnd_spawn(int);
 int	vnd_destroy(device_t);
 
+static struct	dkdriver vnddkdriver = { vndstrategy, minphys };
+
 void
 vndattach(int num)
 {
@@ -281,7 +283,7 @@ vnd_attach(device_t parent, device_t sel
 	sc-sc_comp_buff = NULL;
 	sc-sc_comp_decombuf = NULL;
 	bufq_alloc(sc-sc_tab, disksort, BUFQ_SORT_RAWBLOCK);
-	disk_init(sc-sc_dkdev, device_xname(self), NULL);
+	disk_init(sc-sc_dkdev, device_xname(self), vnddkdriver);
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, couldn't establish power handler\n);
 }
@@ -362,8 +364,20 @@ vndopen(dev_t dev, int flags, int mode, 
 	 * not already valid.
 	 */
 	if ((sc-sc_flags  (VNF_INITED|VNF_VLABEL)) == VNF_INITED 
-	sc-sc_dkdev.dk_openmask == 0)
-		vndgetdisklabel(dev, sc);
+	sc-sc_dkdev.dk_openmask == 0) {
+		/*See if we have wedges, then check for the disklabel*/
+		if (sc-sc_dkdev.dk_nwedges == 0) 
+			vndgetdisklabel(dev, sc);
+	}
+
+	/*
+	 * If there are wedges, and this is not RAW_PART, then we
+	 * need to fail.
+	 */
+	if (sc-sc_dkdev.dk_nwedges != 0  part != RAW_PART) {
+		error = EBUSY;
+		goto done;
+	}
 
 	/* Check that the partitions exists. */
 	if (part != RAW_PART) {
@@ -975,6 +989,8 @@ vndioctl(dev_t dev, u_long cmd, void *da
 #ifdef __HAVE_OLD_DISKLABEL
 	struct disklabel newlabel;
 #endif
+	struct dkwedge_info *dkw;
+	struct dkwedge_list *dkwl;
 
 #ifdef DEBUG
 	if (vnddebug  VDB_FOLLOW)
@@ -1261,7 +1277,15 @@ vndioctl(dev_t dev, u_long cmd, void *da
 		0, 0, vndxpl, NULL, IPL_BIO);
 
 		/* Try and read the disklabel. */
-		vndgetdisklabel(dev, vnd);
+		/*Discover wedges if there are any*/
+		vndgetdefaultlabel(vnd, vnd-sc_dkdev.dk_label); /*XXX: */
+		vndunlock(vnd); /*XXX*/
+		dkwedge_discover(vnd-sc_dkdev);
+		if ((error = vndlock(vnd)) != 0)
+			goto close_and_exit;
+
+		if (vnd-sc_dkdev.dk_nwedges == 0)
+			vndgetdisklabel(dev, vnd);
 
 		vndunlock(vnd);
 
@@ -1322,6 +1346,7 @@ unlock_and_exit:
 		pool_destroy(vnd-sc_vxpool);
 
 		/* Detatch the disk. */
+		dkwedge_delall(vnd-sc_dkdev);
 		disk_detach(vnd-sc_dkdev);
 		break;
 
@@ -1466,6 +1491,33 @@ unlock_and_exit:
 		VOP_UNLOCK(vnd-sc_vp, 0);
 		return error;
 
+	case DIOCAWEDGE:
+		dkw = (void *) data;
+
+		if ((flag  FWRITE) == 0)
+			return EBADF;
+
+		/* If the ioctl happens here, the parent is us. */
+		strlcpy(dkw-dkw_parent, device_xname(vnd-sc_dev),
+		sizeof(dkw-dkw_parent));
+		return dkwedge_add(dkw);
+
+	case DIOCDWEDGE:
+		dkw = (void *) data;
+
+		if ((flag  FWRITE) == 0)
+			return EBADF;
+
+		/* If the ioctl happens here, the parent is us. */
+		strlcpy(dkw-dkw_parent, device_xname(vnd-sc_dev),
+		sizeof(dkw-dkw_parent));
+		return dkwedge_del(dkw);
+
+	case DIOCLWEDGES:
+		dkwl = (void *) data;
+
+		return dkwedge_list(vnd-sc_dkdev, dkwl, l);
+
 	default:
 		return (ENOTTY);
 	}



CVS commit: [netbsd-5] src/sys/dev/usb

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 15:57:28 UTC 2012

Modified Files:
src/sys/dev/usb [netbsd-5]: uaudio.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1746):
sys/dev/usb/uaudio.c: revision 1.120
Address PR#44279.
- Be more lenient to device descriptor inconsistencies.
- Apply Roland SD-90 quirk only to the SD-90.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.114.6.1 src/sys/dev/usb/uaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.114 src/sys/dev/usb/uaudio.c:1.114.6.1
--- src/sys/dev/usb/uaudio.c:1.114	Sat Jun 28 09:14:56 2008
+++ src/sys/dev/usb/uaudio.c	Sat Apr 21 15:57:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.114 2008/06/28 09:14:56 kent Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.114.6.1 2012/04/21 15:57:27 riz Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.114 2008/06/28 09:14:56 kent Exp $);
+__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.114.6.1 2012/04/21 15:57:27 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -65,6 +65,8 @@ __KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1
 #include dev/usb/usbdi_util.h
 #include dev/usb/usb_quirks.h
 
+#include dev/usb/usbdevs.h
+
 #include dev/usb/uaudioreg.h
 
 /* #define UAUDIO_DEBUG */
@@ -1847,7 +1849,7 @@ uaudio_identify_ac(struct uaudio_softc *
 	const struct usb_audio_output_terminal *pot;
 	struct terminal_list *tml;
 	const char *tbuf, *ibuf, *ibufend;
-	int size, offs, aclen, ndps, i, j;
+	int size, offs, ndps, i, j;
 
 	size = UGETW(cdesc-wTotalLength);
 	tbuf = (const char *)cdesc;
@@ -1864,26 +1866,23 @@ uaudio_identify_ac(struct uaudio_softc *
 
 	/* A class-specific AC interface header should follow. */
 	ibuf = tbuf + offs;
+	ibufend = tbuf + size;
 	acdp = (const struct usb_audio_control_descriptor *)ibuf;
 	if (acdp-bDescriptorType != UDESC_CS_INTERFACE ||
 	acdp-bDescriptorSubtype != UDESCSUB_AC_HEADER)
 		return USBD_INVAL;
-	aclen = UGETW(acdp-wTotalLength);
-	if (offs + aclen  size)
-		return USBD_INVAL;
 
 	if (!(usbd_get_quirks(sc-sc_udev)-uq_flags  UQ_BAD_ADC) 
 	 UGETW(acdp-bcdADC) != UAUDIO_VERSION)
 		return USBD_INVAL;
 
 	sc-sc_audio_rev = UGETW(acdp-bcdADC);
-	DPRINTFN(2,(uaudio_identify_ac: found AC header, vers=%03x, len=%d\n,
-		 sc-sc_audio_rev, aclen));
+	DPRINTFN(2,(uaudio_identify_ac: found AC header, vers=%03x\n,
+		 sc-sc_audio_rev));
 
 	sc-sc_nullalt = -1;
 
 	/* Scan through all the AC specific descriptors */
-	ibufend = ibuf + aclen;
 	dp = (const uaudio_cs_descriptor_t *)ibuf;
 	ndps = 0;
 	iot = malloc(sizeof(struct io_terminal) * 256, M_TEMP, M_NOWAIT | M_ZERO);
@@ -1900,12 +1899,8 @@ uaudio_identify_ac(struct uaudio_softc *
 			free(iot, M_TEMP);
 			return USBD_INVAL;
 		}
-		if (dp-bDescriptorType != UDESC_CS_INTERFACE) {
-			aprint_error(
-			uaudio_identify_ac: skip desc type=0x%02x\n,
-			dp-bDescriptorType);
-			continue;
-		}
+		if (dp-bDescriptorType != UDESC_CS_INTERFACE)
+			break;
 		i = ((const struct usb_audio_input_terminal *)dp)-bTerminalId;
 		iot[i].d.desc = dp;
 		if (i  ndps)
@@ -2625,11 +2620,10 @@ uaudio_chan_open(struct uaudio_softc *sc
 		return err;
 
 	/*
-	 * If just one sampling rate is supported,
-	 * no need to call uaudio_set_speed().
 	 * Roland SD-90 freezes by a SAMPLING_FREQ_CONTROL request.
 	 */
-	if (as-asf1desc-bSamFreqType != 1) {
+	if ((UGETW(sc-sc_udev-ddesc.idVendor) != USB_VENDOR_ROLAND) 
+	(UGETW(sc-sc_udev-ddesc.idProduct) != USB_PRODUCT_ROLAND_SD90)) {
 		err = uaudio_set_speed(sc, endpt, ch-sample_rate);
 		if (err) {
 			DPRINTF((uaudio_chan_open: set_speed failed err=%s\n,



CVS commit: [netbsd-5] src/sys/dev/usb

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 22 03:13:21 UTC 2012

Modified Files:
src/sys/dev/usb [netbsd-5]: uaudio.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1751):
sys/dev/usb/uaudio.c: revision 1.131
Use usbd_get_device_descriptor() instead of groping for it directly
in the usbd_device struct.


To generate a diff of this commit:
cvs rdiff -u -r1.114.6.1 -r1.114.6.2 src/sys/dev/usb/uaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.114.6.1 src/sys/dev/usb/uaudio.c:1.114.6.2
--- src/sys/dev/usb/uaudio.c:1.114.6.1	Sat Apr 21 15:57:27 2012
+++ src/sys/dev/usb/uaudio.c	Sun Apr 22 03:13:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.114.6.1 2012/04/21 15:57:27 riz Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.114.6.2 2012/04/22 03:13:21 riz Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.114.6.1 2012/04/21 15:57:27 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.114.6.2 2012/04/22 03:13:21 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -2606,6 +2606,7 @@ Static usbd_status
 uaudio_chan_open(struct uaudio_softc *sc, struct chan *ch)
 {
 	struct as_info *as;
+	usb_device_descriptor_t *ddesc;
 	int endpt;
 	usbd_status err;
 
@@ -2622,8 +2623,9 @@ uaudio_chan_open(struct uaudio_softc *sc
 	/*
 	 * Roland SD-90 freezes by a SAMPLING_FREQ_CONTROL request.
 	 */
-	if ((UGETW(sc-sc_udev-ddesc.idVendor) != USB_VENDOR_ROLAND) 
-	(UGETW(sc-sc_udev-ddesc.idProduct) != USB_PRODUCT_ROLAND_SD90)) {
+	ddesc = usbd_get_device_descriptor(sc-sc_udev);
+	if ((UGETW(ddesc-idVendor) != USB_VENDOR_ROLAND) 
+	(UGETW(ddesc-idProduct) != USB_PRODUCT_ROLAND_SD90)) {
 		err = uaudio_set_speed(sc, endpt, ch-sample_rate);
 		if (err) {
 			DPRINTF((uaudio_chan_open: set_speed failed err=%s\n,



CVS commit: [netbsd-5] src/sys/dev/wscons

2012-03-21 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Mar 21 21:27:37 UTC 2012

Modified Files:
src/sys/dev/wscons [netbsd-5]: wsemul_vt100.c wsemul_vt100_chars.c
wsksymdef.h

Log Message:
Pull up revisions (requested by bouyer in ticket #1727):
  src/sys/dev/wscons/wsemul_vt100.c 1.31
  src/sys/dev/wscons/wsemul_vt100_chars.c   1.12
  src/sys/dev/wscons/wsksymdef.h1.62

s/portugese/portuguese/, spotted by Ari Constancio in PR misc/40202.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.64.1 src/sys/dev/wscons/wsemul_vt100.c
cvs rdiff -u -r1.11 -r1.11.86.1 src/sys/dev/wscons/wsemul_vt100_chars.c
cvs rdiff -u -r1.61.8.1 -r1.61.8.2 src/sys/dev/wscons/wsksymdef.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/wscons/wsemul_vt100.c
diff -u src/sys/dev/wscons/wsemul_vt100.c:1.30 src/sys/dev/wscons/wsemul_vt100.c:1.30.64.1
--- src/sys/dev/wscons/wsemul_vt100.c:1.30	Thu Nov 16 01:33:31 2006
+++ src/sys/dev/wscons/wsemul_vt100.c	Wed Mar 21 21:27:36 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemul_vt100.c,v 1.30 2006/11/16 01:33:31 christos Exp $ */
+/* $NetBSD: wsemul_vt100.c,v 1.30.64.1 2012/03/21 21:27:36 jdc Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wsemul_vt100.c,v 1.30 2006/11/16 01:33:31 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: wsemul_vt100.c,v 1.30.64.1 2012/03/21 21:27:36 jdc Exp $);
 
 #include opt_wsmsgattrs.h
 
@@ -662,7 +662,7 @@ wsemul_vt100_output_scs96(struct wsemul_
 	int nrc;
 
 	switch (c) {
-	case '%': /* probably portugese */
+	case '%': /* probably portuguese */
 		newstate = VT100_EMUL_STATE_SCS96_PERCENT;
 		break;
 	case 'A': /* ISO-latin-1 supplemental */
@@ -713,7 +713,7 @@ static u_int
 wsemul_vt100_output_scs96_percent(struct wsemul_vt100_emuldata *edp, u_char c)
 {
 	switch (c) {
-	case '6': /* portugese */
+	case '6': /* portuguese */
 		vt100_setnrc(edp, 8);
 		break;
 	default:

Index: src/sys/dev/wscons/wsemul_vt100_chars.c
diff -u src/sys/dev/wscons/wsemul_vt100_chars.c:1.11 src/sys/dev/wscons/wsemul_vt100_chars.c:1.11.86.1
--- src/sys/dev/wscons/wsemul_vt100_chars.c:1.11	Sun Dec 11 12:24:12 2005
+++ src/sys/dev/wscons/wsemul_vt100_chars.c	Wed Mar 21 21:27:37 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemul_vt100_chars.c,v 1.11 2005/12/11 12:24:12 christos Exp $ */
+/* $NetBSD: wsemul_vt100_chars.c,v 1.11.86.1 2012/03/21 21:27:37 jdc Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wsemul_vt100_chars.c,v 1.11 2005/12/11 12:24:12 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: wsemul_vt100_chars.c,v 1.11.86.1 2012/03/21 21:27:37 jdc Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -124,7 +124,7 @@ static const struct {
 	/* norwegian /danish */
 	{{0x0023, 0x0040, 0x00c6, 0x00d8, 0x00c5, 0x005e,
 	0x005f, 0x0060, 0x00e6, 0x00f8, 0x00e5, 0x007e}},
-	/* portugese */
+	/* portuguese */
 	{{0x0023, 0x0040, 0x00c3, 0x00c7, 0x00d5, 0x005e,
 	0x005f, 0x0060, 0x00e3, 0x00e7, 0x00f5, 0x007e}},
 	/* spanish */

Index: src/sys/dev/wscons/wsksymdef.h
diff -u src/sys/dev/wscons/wsksymdef.h:1.61.8.1 src/sys/dev/wscons/wsksymdef.h:1.61.8.2
--- src/sys/dev/wscons/wsksymdef.h:1.61.8.1	Sun Nov  1 16:13:10 2009
+++ src/sys/dev/wscons/wsksymdef.h	Wed Mar 21 21:27:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: wsksymdef.h,v 1.61.8.1 2009/11/01 16:13:10 bouyer Exp $ */
+/*	$NetBSD: wsksymdef.h,v 1.61.8.2 2012/03/21 21:27:37 jdc Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -652,7 +652,7 @@ action(KB_IT,	0,	0x0500,	it,	,	Italia
 action(KB_JP,	0,	0x0800,	jp,	,	Japanese)	\
 action(KB_NO,	0,	0x0a00,	no,	,	Norwegian)	\
 action(KB_PL,	0,	0x0d00,	pl,	,	Polish)	\
-action(KB_PT,	0,	0x1100,	pt,	,	Portugese)	\
+action(KB_PT,	0,	0x1100,	pt,	,	Portuguese)	\
 action(KB_RU,	0,	0x0e00,	ru,	,	Russian)	\
 action(KB_ES,	0,	0x0b00,	es,	,	Spanish)	\
 action(KB_SV,	0,	0x0900,	sv,	,	Swedish)	\



CVS commit: [netbsd-5] src/sys/dev/usb

2012-03-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar 17 18:52:01 UTC 2012

Modified Files:
src/sys/dev/usb [netbsd-5]: usbdevs.h usbdevs_data.h

Log Message:
Regen for ticket #1737


To generate a diff of this commit:
cvs rdiff -u -r1.515.4.8 -r1.515.4.9 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.516.4.8 -r1.516.4.9 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.515.4.8 src/sys/dev/usb/usbdevs.h:1.515.4.9
--- src/sys/dev/usb/usbdevs.h:1.515.4.8	Fri Nov 26 17:29:50 2010
+++ src/sys/dev/usb/usbdevs.h	Sat Mar 17 18:52:00 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.515.4.8 2010/11/26 17:29:50 riz Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.515.4.9 2012/03/17 18:52:00 bouyer Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD
+ *	NetBSD: usbdevs,v 1.519.4.9 2012/03/17 18:51:18 bouyer Exp
  */
 
 /*
@@ -107,6 +107,7 @@
 #define	USB_VENDOR_PLANTRONICS	0x047f		/* Plantronics */
 #define	USB_VENDOR_KYOCERA	0x0482		/* Kyocera */
 #define	USB_VENDOR_STMICRO	0x0483		/* STMicroelectronics */
+#define	USB_VENDOR_MEIZU	0x0492		/* Meizu Electronics */
 #define	USB_VENDOR_YAMAHA	0x0499		/* YAMAHA */
 #define	USB_VENDOR_COMPAQ	0x049f		/* Compaq */
 #define	USB_VENDOR_HITACHI	0x04a4		/* Hitachi */
@@ -1379,7 +1380,11 @@
 /* Kingston products */
 #define	USB_PRODUCT_KINGSTON_XX1	0x0008		/* Ethernet Adapter */
 #define	USB_PRODUCT_KINGSTON_KNU101TX	0x000a		/* KNU101TX USB Ethernet */
+#define	USB_PRODUCT_KINGSTON_DT102_G2	0x1624		/* DT 102 G2 */
+#define	USB_PRODUCT_KINGSTON_DT101_II	0x1625		/* DT 101 II */
 #define	USB_PRODUCT_KINGSTON_DTMINI10	0x162c		/* DT Mini 10 */
+#define	USB_PRODUCT_KINGSTON_DT101_G2	0x1642		/* DT 101 G2 */
+#define	USB_PRODUCT_KINGSTON_DT100_G2	0x6544		/* DT 100 G2 */
 
 /* Kodak products */
 #define	USB_PRODUCT_KODAK_DC220	0x0100		/* Digital Science DC220 */
@@ -1491,6 +1496,9 @@
 /* MediaGear products */
 #define	USB_PRODUCT_MEDIAGEAR_READER9IN1	0x5003		/* USB2.0 9 in 1 Reader */
 
+/* Meizo Electronics */
+#define	USB_PRODUCT_MEIZU_M6_SL	0x0140		/* MiniPlayer M6 (SL) */
+
 /* Melco, Inc products */
 #define	USB_PRODUCT_MELCO_LUATX1	0x0001		/* LUA-TX Ethernet */
 #define	USB_PRODUCT_MELCO_LUATX5	0x0005		/* LUA-TX Ethernet */
@@ -1786,6 +1794,7 @@
 /* Philips products */
 #define	USB_PRODUCT_PHILIPS_DSS350	0x0101		/* DSS 350 Digital Speaker System */
 #define	USB_PRODUCT_PHILIPS_DSS	0x0104		/* DSS XXX Digital Speaker System */
+#define	USB_PRODUCT_PHILIPS_SA235	0x016a		/* SA235 */
 #define	USB_PRODUCT_PHILIPS_HUB	0x0201		/* hub */
 #define	USB_PRODUCT_PHILIPS_PCA645VC	0x0302		/* PCA645VC PC Camera */
 #define	USB_PRODUCT_PHILIPS_PCA646VC	0x0303		/* PCA646VC PC Camera */
@@ -1983,6 +1992,7 @@
 #define	USB_PRODUCT_SANDISK_SDDR09	0x0200		/* ImageMate SDDR-09 */
 #define	USB_PRODUCT_SANDISK_SDDR86	0x0621		/* ImageMate SDDR-86 */
 #define	USB_PRODUCT_SANDISK_SDDR75	0x0810		/* ImageMate SDDR-75 */
+#define	USB_PRODUCT_SANDISK_SANSA_CLIP	0x7433		/* Sansa Clip */
 
 /* Sanwa Supply products */
 #define	USB_PRODUCT_SANWASUPPLY_JYDV9USB	0x9806		/* JY-DV9USB gamepad */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.516.4.8 src/sys/dev/usb/usbdevs_data.h:1.516.4.9
--- src/sys/dev/usb/usbdevs_data.h:1.516.4.8	Fri Nov 26 17:29:50 2010
+++ src/sys/dev/usb/usbdevs_data.h	Sat Mar 17 18:52:00 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.516.4.8 2010/11/26 17:29:50 riz Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.516.4.9 2012/03/17 18:52:00 bouyer Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD
+ *	NetBSD: usbdevs,v 1.519.4.9 2012/03/17 18:51:18 bouyer Exp
  */
 
 /*
@@ -223,6 +223,10 @@ const struct usb_vendor usb_vendors[] = 
 	STMicroelectronics,
 	},
 	{
+	USB_VENDOR_MEIZU,
+	Meizu Electronics,
+	},
+	{
 	USB_VENDOR_YAMAHA,
 	YAMAHA,
 	},
@@ -1863,7 +1867,7 @@ const struct usb_vendor usb_vendors[] = 
 	GNU Radio USRP,
 	},
 };
-const int usb_nvendors = 456;
+const int usb_nvendors = 457;
 
 const struct usb_product usb_products[] = {
 	{
@@ -4083,10 +4087,26 @@ const struct usb_product usb_products[] 
 	KNU101TX USB Ethernet,
 	},
 	{
+	USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DT102_G2,
+	DT 102 G2,
+	},
+	{
+	USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DT101_II,
+	DT 101 II,
+	},
+	{
 	USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DTMINI10,
 	DT Mini 10,
 	},
 	{
+	USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DT101_G2,
+	DT 101 G2,
+	},
+	{
+	USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DT100_G2,
+	DT 100 G2,
+	},
+	{
 	USB_VENDOR_KODAK, USB_PRODUCT_KODAK_DC220,
 	Digital Science DC220,
 	},
@@ -4407,6 +4427,10 @@ const struct usb_product usb_products[] 
 	USB2.0 9 in 1 Reader,
 	},
 	{
+	

CVS commit: [netbsd-5] src/sys/dev/pci

2012-03-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar 17 19:05:39 UTC 2012

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs piixide.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1739):
sys/dev/pci/piixide.c: revision 1.58
sys/dev/pci/pcidevs: patch
Add support for Intel 6 Series Serial ATA Controller


To generate a diff of this commit:
cvs rdiff -u -r1.962.4.15 -r1.962.4.16 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.47.4.1 -r1.47.4.2 src/sys/dev/pci/piixide.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.962.4.15 src/sys/dev/pci/pcidevs:1.962.4.16
--- src/sys/dev/pci/pcidevs:1.962.4.15	Mon Nov 22 03:39:08 2010
+++ src/sys/dev/pci/pcidevs	Sat Mar 17 19:05:38 2012
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.15 2010/11/22 03:39:08 riz Exp $
+$NetBSD: pcidevs,v 1.962.4.16 2012/03/17 19:05:38 bouyer Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2312,6 +2312,31 @@ product INTEL 82840_AGP		0x1a23	82840 AG
 product INTEL 82840_PCI		0x1a24	82840 PCI
 product INTEL 82845_HB		0x1a30	82845 Host
 product INTEL 82845_AGP		0x1a31	82845 AGP
+product INTEL 6SERIES_SATA_1	0x1c00	6 Series SATA
+product INTEL 6SERIES_SATA_2	0x1c01	6 Series SATA
+product INTEL 6SERIES_AHCI_1	0x1c02	6 Series AHCI
+product INTEL 6SERIES_AHCI_2	0x1c03	6 Series AHCI
+product INTEL 6SERIES_RAID_1	0x1c04	6 Series RAID
+product INTEL 6SERIES_RAID_2	0x1c05	6 Series RAID
+product INTEL 6SERIES_RAID_3	0x1c06	6 Series RAID
+product INTEL 6SERIES_SATA_3	0x1c08	6 Series SATA
+product INTEL 6SERIES_SATA_4	0x1c09	6 Series SATA
+product INTEL 6SERIES_PCIE_1	0x1c10	6 Series PCIE
+product INTEL 6SERIES_PCIE_2	0x1c12	6 Series PCIE
+product INTEL 6SERIES_PCIE_3	0x1c14	6 Series PCIE
+product INTEL 6SERIES_PCIE_4	0x1c16	6 Series PCIE
+product INTEL 6SERIES_PCIE_5	0x1c18	6 Series PCIE
+product INTEL 6SERIES_PCIE_6	0x1c1a	6 Series PCIE
+product INTEL 6SERIES_PCIE_7	0x1c1c	6 Series PCIE
+product INTEL 6SERIES_PCIE_8	0x1c1e	6 Series PCIE
+product INTEL 6SERIES_HDA	0x1c20	6 Series HD Audio
+product INTEL 6SERIES_SMB	0x1c22	6 Series SMBus
+product INTEL 6SERIES_THERM	0x1c24	6 Series Thermal
+product INTEL 6SERIES_DMI	0x1c25	6 Series DMI-PCI
+product INTEL 6SERIES_EHCI_1	0x1c26	6 Series USB
+product INTEL 6SERIES_EHCI_2	0x1c2d	6 Series USB
+product INTEL 6SERIES_MEI	0x1c3a	6 Series MEI
+product INTEL 6SERIES_KT	0x1c3d	6 Series KT
 product INTEL 82801AA_LPC	0x2410	82801AA LPC Interface Bridge
 product INTEL 82801AA_IDE	0x2411	82801AA IDE Controller
 product INTEL 82801AA_USB	0x2412	82801AA USB Controller

Index: src/sys/dev/pci/piixide.c
diff -u src/sys/dev/pci/piixide.c:1.47.4.1 src/sys/dev/pci/piixide.c:1.47.4.2
--- src/sys/dev/pci/piixide.c:1.47.4.1	Fri Dec 18 05:48:07 2009
+++ src/sys/dev/pci/piixide.c	Sat Mar 17 19:05:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: piixide.c,v 1.47.4.1 2009/12/18 05:48:07 snj Exp $	*/
+/*	$NetBSD: piixide.c,v 1.47.4.2 2012/03/17 19:05:39 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: piixide.c,v 1.47.4.1 2009/12/18 05:48:07 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: piixide.c,v 1.47.4.2 2012/03/17 19:05:39 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -308,6 +308,30 @@ static const struct pciide_product_desc 
 	  Intel 3400 Serial ATA Controller,
 	  piixsata_chip_map,
 	},
+	{
+	  PCI_PRODUCT_INTEL_6SERIES_SATA_1,
+	  0,
+	  Intel 6 Series Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_6SERIES_SATA_2,
+	  0,
+	  Intel 6 Series Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_6SERIES_SATA_3,
+	  0,
+	  Intel 6 Series Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_6SERIES_SATA_4,
+	  0,
+	  Intel 6 Series Serial ATA Controller,
+	  piixsata_chip_map,
+	},
 	{ 0,
 	  0,
 	  NULL,



CVS commit: [netbsd-5] src/sys/dev/pci

2012-03-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar 17 19:06:41 UTC 2012

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket 1739


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.15 -r1.963.4.16 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.15 -r1.962.4.16 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.15 src/sys/dev/pci/pcidevs.h:1.963.4.16
--- src/sys/dev/pci/pcidevs.h:1.963.4.15	Mon Nov 22 03:40:00 2010
+++ src/sys/dev/pci/pcidevs.h	Sat Mar 17 19:06:21 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.15 2010/11/22 03:40:00 riz Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.16 2012/03/17 19:06:21 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD
+ *	NetBSD: pcidevs,v 1.962.4.16 2012/03/17 19:05:38 bouyer Exp
  */
 
 /*
@@ -2319,6 +2319,31 @@
 #define	PCI_PRODUCT_INTEL_82840_PCI	0x1a24		/* 82840 PCI */
 #define	PCI_PRODUCT_INTEL_82845_HB	0x1a30		/* 82845 Host */
 #define	PCI_PRODUCT_INTEL_82845_AGP	0x1a31		/* 82845 AGP */
+#define	PCI_PRODUCT_INTEL_6SERIES_SATA_1	0x1c00		/* 6 Series SATA */
+#define	PCI_PRODUCT_INTEL_6SERIES_SATA_2	0x1c01		/* 6 Series SATA */
+#define	PCI_PRODUCT_INTEL_6SERIES_AHCI_1	0x1c02		/* 6 Series AHCI */
+#define	PCI_PRODUCT_INTEL_6SERIES_AHCI_2	0x1c03		/* 6 Series AHCI */
+#define	PCI_PRODUCT_INTEL_6SERIES_RAID_1	0x1c04		/* 6 Series RAID */
+#define	PCI_PRODUCT_INTEL_6SERIES_RAID_2	0x1c05		/* 6 Series RAID */
+#define	PCI_PRODUCT_INTEL_6SERIES_RAID_3	0x1c06		/* 6 Series RAID */
+#define	PCI_PRODUCT_INTEL_6SERIES_SATA_3	0x1c08		/* 6 Series SATA */
+#define	PCI_PRODUCT_INTEL_6SERIES_SATA_4	0x1c09		/* 6 Series SATA */
+#define	PCI_PRODUCT_INTEL_6SERIES_PCIE_1	0x1c10		/* 6 Series PCIE */
+#define	PCI_PRODUCT_INTEL_6SERIES_PCIE_2	0x1c12		/* 6 Series PCIE */
+#define	PCI_PRODUCT_INTEL_6SERIES_PCIE_3	0x1c14		/* 6 Series PCIE */
+#define	PCI_PRODUCT_INTEL_6SERIES_PCIE_4	0x1c16		/* 6 Series PCIE */
+#define	PCI_PRODUCT_INTEL_6SERIES_PCIE_5	0x1c18		/* 6 Series PCIE */
+#define	PCI_PRODUCT_INTEL_6SERIES_PCIE_6	0x1c1a		/* 6 Series PCIE */
+#define	PCI_PRODUCT_INTEL_6SERIES_PCIE_7	0x1c1c		/* 6 Series PCIE */
+#define	PCI_PRODUCT_INTEL_6SERIES_PCIE_8	0x1c1e		/* 6 Series PCIE */
+#define	PCI_PRODUCT_INTEL_6SERIES_HDA	0x1c20		/* 6 Series HD Audio */
+#define	PCI_PRODUCT_INTEL_6SERIES_SMB	0x1c22		/* 6 Series SMBus */
+#define	PCI_PRODUCT_INTEL_6SERIES_THERM	0x1c24		/* 6 Series Thermal */
+#define	PCI_PRODUCT_INTEL_6SERIES_DMI	0x1c25		/* 6 Series DMI-PCI */
+#define	PCI_PRODUCT_INTEL_6SERIES_EHCI_1	0x1c26		/* 6 Series USB */
+#define	PCI_PRODUCT_INTEL_6SERIES_EHCI_2	0x1c2d		/* 6 Series USB */
+#define	PCI_PRODUCT_INTEL_6SERIES_MEI	0x1c3a		/* 6 Series MEI */
+#define	PCI_PRODUCT_INTEL_6SERIES_KT	0x1c3d		/* 6 Series KT */
 #define	PCI_PRODUCT_INTEL_82801AA_LPC	0x2410		/* 82801AA LPC Interface Bridge */
 #define	PCI_PRODUCT_INTEL_82801AA_IDE	0x2411		/* 82801AA IDE Controller */
 #define	PCI_PRODUCT_INTEL_82801AA_USB	0x2412		/* 82801AA USB Controller */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.15 src/sys/dev/pci/pcidevs_data.h:1.962.4.16
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.15	Mon Nov 22 03:40:00 2010
+++ src/sys/dev/pci/pcidevs_data.h	Sat Mar 17 19:06:21 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.15 2010/11/22 03:40:00 riz Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.16 2012/03/17 19:06:21 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD
+ *	NetBSD: pcidevs,v 1.962.4.16 2012/03/17 19:05:38 bouyer Exp
  */
 
 /*
@@ -8104,6 +8104,106 @@ static const struct pci_product pci_prod
 	82845 AGP,
 	},
 	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_SATA_1,
+	6 Series SATA,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_SATA_2,
+	6 Series SATA,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_AHCI_1,
+	6 Series AHCI,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_AHCI_2,
+	6 Series AHCI,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_RAID_1,
+	6 Series RAID,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_RAID_2,
+	6 Series RAID,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_RAID_3,
+	6 Series RAID,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_SATA_3,
+	6 Series SATA,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_SATA_4,
+	6 Series SATA,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_PCIE_1,
+	6 Series PCIE,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_PCIE_2,
+	6 Series PCIE,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_6SERIES_PCIE_3,
+	6 Series PCIE,
+	},
+	{
+	   

CVS commit: [netbsd-5] src/sys/dev/raidframe

2012-02-24 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Feb 24 17:58:45 UTC 2012

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_reconmap.c rf_reconstruct.c

Log Message:
Pull up the following revisions(s) (requested by oster in ticket #1728):
sys/dev/raidframe/rf_reconmap.c:revision 1.34
sys/dev/raidframe/rf_reconstruct.c: revision 1.118

Remove a DIAGNOSTIC check that is invalid for RAID5_RS.
Add logic to the main reconstruction loop to handle RAID5 with rotated
spares. Correct issue where we were doing one more stripe than necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.8.1 src/sys/dev/raidframe/rf_reconmap.c
cvs rdiff -u -r1.105.4.4 -r1.105.4.5 src/sys/dev/raidframe/rf_reconstruct.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_reconmap.c
diff -u src/sys/dev/raidframe/rf_reconmap.c:1.31 src/sys/dev/raidframe/rf_reconmap.c:1.31.8.1
--- src/sys/dev/raidframe/rf_reconmap.c:1.31	Mon May 19 19:49:54 2008
+++ src/sys/dev/raidframe/rf_reconmap.c	Fri Feb 24 17:58:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_reconmap.c,v 1.31 2008/05/19 19:49:54 oster Exp $	*/
+/*	$NetBSD: rf_reconmap.c,v 1.31.8.1 2012/02/24 17:58:44 sborrill Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_reconmap.c,v 1.31 2008/05/19 19:49:54 oster Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_reconmap.c,v 1.31.8.1 2012/02/24 17:58:44 sborrill Exp $);
 
 #include rf_raid.h
 #include sys/time.h
@@ -156,7 +156,14 @@ rf_ReconMapUpdate(RF_Raid_t *raidPtr, RF
 
 		/* do we need to move the queue? */
 		while (i  mapPtr-high_ru) {
+#if 0
 #ifdef DIAGNOSTIC
+			/* XXX: The check below is not valid for
+			 * RAID5_RS.  It is valid for RAID 1 and RAID 5.
+			 * The issue is that we can easily have
+			 * RU_NOTHING entries here too, and those are
+			 * quite correct.
+			 */
 			if (mapPtr-status[mapPtr-head]!=RU_ALL) {
 printf(\nraid%d: reconmap incorrect -- working on i % PRIu64 \n,
    raidPtr-raidid, i);
@@ -169,6 +176,7 @@ rf_ReconMapUpdate(RF_Raid_t *raidPtr, RF
 panic(reconmap incorrect);
 			} 
 #endif
+#endif
 			mapPtr-low_ru++;
 			mapPtr-high_ru++;
 			/* initialize highest RU status entry, which

Index: src/sys/dev/raidframe/rf_reconstruct.c
diff -u src/sys/dev/raidframe/rf_reconstruct.c:1.105.4.4 src/sys/dev/raidframe/rf_reconstruct.c:1.105.4.5
--- src/sys/dev/raidframe/rf_reconstruct.c:1.105.4.4	Sun Nov 21 22:06:53 2010
+++ src/sys/dev/raidframe/rf_reconstruct.c	Fri Feb 24 17:58:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_reconstruct.c,v 1.105.4.4 2010/11/21 22:06:53 riz Exp $	*/
+/*	$NetBSD: rf_reconstruct.c,v 1.105.4.5 2012/02/24 17:58:44 sborrill Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  /
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_reconstruct.c,v 1.105.4.4 2010/11/21 22:06:53 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_reconstruct.c,v 1.105.4.5 2012/02/24 17:58:44 sborrill Exp $);
 
 #include sys/param.h
 #include sys/time.h
@@ -557,6 +557,9 @@ rf_ContinueReconstructFailedDisk(RF_Raid
 	RF_ReconCtrl_t *tmp_reconctrl;
 	RF_ReconEvent_t *event;
 	RF_StripeCount_t incPSID,lastPSID,num_writes,pending_writes,prev;
+#if RF_INCLUDE_RAID5_RS  0
+	RF_StripeCount_t startPSID,endPSID,aPSID,bPSID,offPSID;
+#endif
 	RF_ReconUnitCount_t RUsPerPU;
 	struct timeval etime, elpsd;
 	unsigned long xor_s, xor_resid_us;
@@ -609,7 +612,17 @@ rf_ContinueReconstructFailedDisk(RF_Raid
 	recon_error = 0;
 	write_error = 0;
 	pending_writes = incPSID;
-	raidPtr-reconControl-lastPSID = incPSID;
+	raidPtr-reconControl-lastPSID = incPSID - 1;
+
+	/* bounds check raidPtr-reconControl-lastPSID and
+	   pending_writes so that we don't attempt to wait for more IO
+	   than can possibly happen */
+
+	if (raidPtr-reconControl-lastPSID  lastPSID)
+		raidPtr-reconControl-lastPSID = lastPSID;
+
+	if (pending_writes  lastPSID)
+		pending_writes = lastPSID;
 
 	/* start the actual reconstruction */
 
@@ -623,6 +636,49 @@ rf_ContinueReconstructFailedDisk(RF_Raid
 		}
 
 		num_writes = 0;
+
+#if RF_INCLUDE_RAID5_RS  0
+		/* For RAID5 with Rotated Spares we will be 'short'
+		   some number of writes since no writes will get
+		   issued for stripes where the spare is on the
+		   component being rebuilt.  Account for the shortage
+		   here so that we don't hang indefinitely below
+		   waiting for writes to complete that were never
+		   scheduled.
+
+		   XXX: Should be fixed for PARITY_DECLUSTERING and
+		   others too! 
+
+		*/
+
+		if (raidPtr-Layout.numDataCol  
+		raidPtr-numCol - raidPtr-Layout.numParityCol) {
+			/* numDataCol is at least 2 less 

CVS commit: [netbsd-5] src/sys/dev/ic

2012-02-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Feb  4 17:05:56 UTC 2012

Modified Files:
src/sys/dev/ic [netbsd-5]: mpt_netbsd.c

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #1720):
sys/dev/ic/mpt_netbsd.c: revision 1.17
Allow adapters with SAS/SATA or FC devices to use tagged queuing by the scsipi
layer.  Can improve write performance on SAS adapters under certain conditions
when the logical drive does not have write caching enabled.  Also need to
reserver a couple of slots for commands for the driver to use - stops the
adapter shortage messages.  Multiple commands can now cause QUEUE_FULL events,
so add that to the events handled, currently just ignoring it.  Changes
based on the thread 
http://mail-index.netbsd.org/tech-kern/2011/02/08/msg009946.html.
cvs: --


To generate a diff of this commit:
cvs rdiff -u -r1.14.14.1 -r1.14.14.2 src/sys/dev/ic/mpt_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/mpt_netbsd.c
diff -u src/sys/dev/ic/mpt_netbsd.c:1.14.14.1 src/sys/dev/ic/mpt_netbsd.c:1.14.14.2
--- src/sys/dev/ic/mpt_netbsd.c:1.14.14.1	Thu Dec  2 23:45:59 2010
+++ src/sys/dev/ic/mpt_netbsd.c	Sat Feb  4 17:05:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpt_netbsd.c,v 1.14.14.1 2010/12/02 23:45:59 snj Exp $	*/
+/*	$NetBSD: mpt_netbsd.c,v 1.14.14.2 2012/02/04 17:05:56 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mpt_netbsd.c,v 1.14.14.1 2010/12/02 23:45:59 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: mpt_netbsd.c,v 1.14.14.2 2012/02/04 17:05:56 bouyer Exp $);
 
 #include dev/ic/mpt.h			/* pulls in all headers */
 
@@ -112,8 +112,8 @@ mpt_scsipi_attach(mpt_softc_t *mpt)
 	memset(adapt, 0, sizeof(*adapt));
 	adapt-adapt_dev = mpt-sc_dev;
 	adapt-adapt_nchannels = 1;
-	adapt-adapt_openings = maxq;
-	adapt-adapt_max_periph = maxq;
+	adapt-adapt_openings = maxq - 2;	/* Reserve 2 for driver use*/
+	adapt-adapt_max_periph = maxq - 2;
 	adapt-adapt_request = mpt_scsipi_request;
 	adapt-adapt_minphys = mpt_minphys;
 
@@ -939,14 +939,6 @@ mpt_set_xfer_mode(mpt_softc_t *mpt, stru
 {
 	fCONFIG_PAGE_SCSI_DEVICE_1 tmp;
 
-	if (!mpt-is_scsi) {
-		/*
-		 * SCSI transport settings don't make any sense for
-		 * Fibre Channel; silently ignore the request.
-		 */
-		return;
-	}
-
 	/*
 	 * Always allow disconnect; we don't have a way to disable
 	 * it right now, in any case.
@@ -958,64 +950,71 @@ mpt_set_xfer_mode(mpt_softc_t *mpt, stru
 	else
 		mpt-mpt_tag_enable = ~(1  xm-xm_target);
 
-	tmp = mpt-mpt_dev_page1[xm-xm_target];
+	if (mpt-is_scsi) {
+		/*
+		 * SCSI transport settings only make any sense for
+		 * SCSI
+		 */
 
-	/*
-	 * Set the wide/narrow parameter for the target.
-	 */
-	if (xm-xm_mode  PERIPH_CAP_WIDE16)
-		tmp.RequestedParameters |= MPI_SCSIDEVPAGE1_RP_WIDE;
-	else
-		tmp.RequestedParameters = ~MPI_SCSIDEVPAGE1_RP_WIDE;
+		tmp = mpt-mpt_dev_page1[xm-xm_target];
 
-	/*
-	 * Set the synchronous parameters for the target.
-	 *
-	 * XXX If we request sync transfers, we just go ahead and
-	 * XXX request the maximum available.  We need finer control
-	 * XXX in order to implement Domain Validation.
-	 */
-	tmp.RequestedParameters = ~(MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK |
-	MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK |
-	MPI_SCSIDEVPAGE1_RP_DT | MPI_SCSIDEVPAGE1_RP_QAS |
-	MPI_SCSIDEVPAGE1_RP_IU);
-	if (xm-xm_mode  PERIPH_CAP_SYNC) {
-		int factor, offset, np;
-
-		factor = (mpt-mpt_port_page0.Capabilities  8)  0xff;
-		offset = (mpt-mpt_port_page0.Capabilities  16)  0xff;
-		np = 0;
-		if (factor  0x9) {
-			/* Ultra320 */
-			np |= MPI_SCSIDEVPAGE1_RP_QAS | MPI_SCSIDEVPAGE1_RP_IU;
-		}
-		if (factor  0xa) {
-			/* at least Ultra160 */
-			np |= MPI_SCSIDEVPAGE1_RP_DT;
+		/*
+		 * Set the wide/narrow parameter for the target.
+		 */
+		if (xm-xm_mode  PERIPH_CAP_WIDE16)
+			tmp.RequestedParameters |= MPI_SCSIDEVPAGE1_RP_WIDE;
+		else
+			tmp.RequestedParameters = ~MPI_SCSIDEVPAGE1_RP_WIDE;
+
+		/*
+		 * Set the synchronous parameters for the target.
+		 *
+		 * XXX If we request sync transfers, we just go ahead and
+		 * XXX request the maximum available.  We need finer control
+		 * XXX in order to implement Domain Validation.
+		 */
+		tmp.RequestedParameters = ~(MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK |
+		MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK |
+		MPI_SCSIDEVPAGE1_RP_DT | MPI_SCSIDEVPAGE1_RP_QAS |
+		MPI_SCSIDEVPAGE1_RP_IU);
+		if (xm-xm_mode  PERIPH_CAP_SYNC) {
+			int factor, offset, np;
+
+			factor = (mpt-mpt_port_page0.Capabilities  8)  0xff;
+			offset = (mpt-mpt_port_page0.Capabilities  16)  0xff;
+			np = 0;
+			if (factor  0x9) {
+/* Ultra320 */
+np |= MPI_SCSIDEVPAGE1_RP_QAS | MPI_SCSIDEVPAGE1_RP_IU;
+			}
+			if (factor  0xa) {
+/* 

CVS commit: [netbsd-5] src/sys/dev/usb

2012-01-25 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan 25 17:33:17 UTC 2012

Modified Files:
src/sys/dev/usb [netbsd-5]: ugen.c

Log Message:
Pull up following revision(s) (requested by gavan in ticket #1697):
sys/dev/usb/ugen.c: revision 1.112
Implement timeouts when blocking the calling process with tsleep.
Fixes PR kern/33452


To generate a diff of this commit:
cvs rdiff -u -r1.99.8.3 -r1.99.8.4 src/sys/dev/usb/ugen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.99.8.3 src/sys/dev/usb/ugen.c:1.99.8.4
--- src/sys/dev/usb/ugen.c:1.99.8.3	Tue Mar  9 03:54:44 2010
+++ src/sys/dev/usb/ugen.c	Wed Jan 25 17:33:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugen.c,v 1.99.8.3 2010/03/09 03:54:44 snj Exp $	*/
+/*	$NetBSD: ugen.c,v 1.99.8.4 2012/01/25 17:33:17 riz Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ugen.c,v 1.99.8.3 2010/03/09 03:54:44 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ugen.c,v 1.99.8.4 2012/01/25 17:33:17 riz Exp $);
 
 #include opt_ugen_bulk_ra_wb.h
 #include opt_compat_netbsd.h
@@ -605,7 +605,7 @@ ugen_do_read(struct ugen_softc *sc, int 
 			}
 			sce-state |= UGEN_ASLP;
 			DPRINTFN(5, (ugenread: sleep on %p\n, sce));
-			error = tsleep(sce, PZERO | PCATCH, ugenri, 0);
+			error = tsleep(sce, PZERO | PCATCH, ugenri, mstohz(sce-timeout));
 			DPRINTFN(5, (ugenread: woke, error=%d\n, error));
 			if (sc-sc_dying)
 error = EIO;
@@ -651,7 +651,7 @@ ugen_do_read(struct ugen_softc *sc, int 
 		 (ugenread: sleep on %p\n,
 		  sce));
 	error = tsleep(sce, PZERO | PCATCH,
-		   ugenrb, 0);
+		   ugenrb, mstohz(sce-timeout));
 	DPRINTFN(5,
 		 (ugenread: woke, error=%d\n,
 		  error));
@@ -743,7 +743,7 @@ ugen_do_read(struct ugen_softc *sc, int 
 			}
 			sce-state |= UGEN_ASLP;
 			DPRINTFN(5, (ugenread: sleep on %p\n, sce));
-			error = tsleep(sce, PZERO | PCATCH, ugenri, 0);
+			error = tsleep(sce, PZERO | PCATCH, ugenri, mstohz(sce-timeout));
 			DPRINTFN(5, (ugenread: woke, error=%d\n, error));
 			if (sc-sc_dying)
 error = EIO;
@@ -851,7 +851,7 @@ ugen_do_write(struct ugen_softc *sc, int
 		 (ugenwrite: sleep on %p\n,
 		  sce));
 	error = tsleep(sce, PZERO | PCATCH,
-		   ugenwb, 0);
+		   ugenwb, mstohz(sce-timeout));
 	DPRINTFN(5,
 		 (ugenwrite: woke, error=%d\n,
 		  error));



CVS commit: [netbsd-5] src/sys/dev/pci

2012-01-25 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan 25 18:02:17 UTC 2012

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wm.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1699):
sys/dev/pci/if_wm.c: revision 1.225
There is problem with 82576 chips (and probably 82575 too) with hardware vlan
tagging: some packets are sent untagged on the wire.
Follow OpenBSD and disable hardware vlan tagging for these chips
(I couldn't find a hint in other open-source drivers at what could be
wrong ...)


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.15 -r1.162.4.16 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.15 src/sys/dev/pci/if_wm.c:1.162.4.16
--- src/sys/dev/pci/if_wm.c:1.162.4.15	Mon Mar  7 04:14:19 2011
+++ src/sys/dev/pci/if_wm.c	Wed Jan 25 18:02:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.15 2011/03/07 04:14:19 riz Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.16 2012/01/25 18:02:17 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.15 2011/03/07 04:14:19 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.16 2012/01/25 18:02:17 riz Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -1818,7 +1818,9 @@ wm_attach(device_t parent, device_t self
 	/*
 	 * If we're a i82543 or greater, we can support VLANs.
 	 */
-	if (sc-sc_type = WM_T_82543)
+	if (sc-sc_type == WM_T_82575 || sc-sc_type == WM_T_82576)
+		sc-sc_ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU;
+	else if (sc-sc_type = WM_T_82543)
 		sc-sc_ethercom.ec_capabilities |=
 		ETHERCAP_VLAN_MTU | ETHERCAP_VLAN_HWTAGGING;
 



CVS commit: [netbsd-5] src/sys/dev/ic

2012-01-25 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan 25 18:02:45 UTC 2012

Modified Files:
src/sys/dev/ic [netbsd-5]: rtl8169.c rtl81x9reg.h rtl81x9var.h

Log Message:
Pull up following revision(s) (requested by garbled in ticket #1698):
sys/dev/ic/rtl81x9var.h: revision 1.52
sys/dev/ic/rtl8169.c: revision 1.134
sys/dev/ic/rtl81x9reg.h: revision 1.42
Add support to recognize the 8168E model of this chip.  Taken from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.105.4.8 -r1.105.4.9 src/sys/dev/ic/rtl8169.c
cvs rdiff -u -r1.32.4.4 -r1.32.4.5 src/sys/dev/ic/rtl81x9reg.h
cvs rdiff -u -r1.41.12.5 -r1.41.12.6 src/sys/dev/ic/rtl81x9var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/rtl8169.c
diff -u src/sys/dev/ic/rtl8169.c:1.105.4.8 src/sys/dev/ic/rtl8169.c:1.105.4.9
--- src/sys/dev/ic/rtl8169.c:1.105.4.8	Fri Jun 19 21:51:43 2009
+++ src/sys/dev/ic/rtl8169.c	Wed Jan 25 18:02:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtl8169.c,v 1.105.4.8 2009/06/19 21:51:43 snj Exp $	*/
+/*	$NetBSD: rtl8169.c,v 1.105.4.9 2012/01/25 18:02:44 riz Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtl8169.c,v 1.105.4.8 2009/06/19 21:51:43 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtl8169.c,v 1.105.4.9 2012/01/25 18:02:44 riz Exp $);
 /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
 
 /*
@@ -603,6 +603,11 @@ re_attach(struct rtk_softc *sc)
 			 */
 			sc-sc_quirk |= RTKQ_NOJUMBO;
 			break;
+		case RTK_HWREV_8168E:
+			sc-sc_quirk |= RTKQ_DESCV2 | RTKQ_NOEECMD |
+			RTKQ_MACSTAT | RTKQ_CMDSTOP | RTKQ_PHYWAKE_PM |
+			RTKQ_NOJUMBO;
+			break;
 		case RTK_HWREV_8100E:
 		case RTK_HWREV_8100E_SPIN2:
 		case RTK_HWREV_8101E:
@@ -661,6 +666,10 @@ re_attach(struct rtk_softc *sc)
 		}
 	}
 
+	/* Take PHY out of power down mode. */
+	if ((sc-sc_quirk  RTKQ_PHYWAKE_PM) != 0)
+		CSR_WRITE_1(sc, RTK_PMCH, CSR_READ_1(sc, RTK_PMCH) | 0x80);
+
 	aprint_normal_dev(sc-sc_dev, Ethernet address %s\n,
 	ether_sprintf(eaddr));
 

Index: src/sys/dev/ic/rtl81x9reg.h
diff -u src/sys/dev/ic/rtl81x9reg.h:1.32.4.4 src/sys/dev/ic/rtl81x9reg.h:1.32.4.5
--- src/sys/dev/ic/rtl81x9reg.h:1.32.4.4	Fri Jun 19 21:51:43 2009
+++ src/sys/dev/ic/rtl81x9reg.h	Wed Jan 25 18:02:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtl81x9reg.h,v 1.32.4.4 2009/06/19 21:51:43 snj Exp $	*/
+/*	$NetBSD: rtl81x9reg.h,v 1.32.4.5 2012/01/25 18:02:45 riz Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998
@@ -130,6 +130,7 @@
 #define RTK_CSIAR		0x0068  
 #define RTK_TBI_LPAR		0x006A
 #define RTK_GMEDIASTAT		0x006C	/* 8 bits */
+#define RTK_PMCH		0x006F	/* 8 bits */
 #define RTK_EPHYAR		0x0080
 #define RTK_LDPS		0x0082	/* Link Down Power Saving */
 #define RTK_DBG_REG		0x00D1
@@ -161,6 +162,7 @@
 #define RTK_HWREV_8103E		0x24C0
 #define RTK_HWREV_8168D		0x2800
 #define RTK_HWREV_8168DP	0x2880
+#define RTK_HWREV_8168E		0x2C00
 #define RTK_HWREV_8168_SPIN1	0x3000
 #define RTK_HWREV_8100E		0x3080
 #define RTK_HWREV_8101E		0x3400

Index: src/sys/dev/ic/rtl81x9var.h
diff -u src/sys/dev/ic/rtl81x9var.h:1.41.12.5 src/sys/dev/ic/rtl81x9var.h:1.41.12.6
--- src/sys/dev/ic/rtl81x9var.h:1.41.12.5	Fri Jun 19 21:51:43 2009
+++ src/sys/dev/ic/rtl81x9var.h	Wed Jan 25 18:02:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtl81x9var.h,v 1.41.12.5 2009/06/19 21:51:43 snj Exp $	*/
+/*	$NetBSD: rtl81x9var.h,v 1.41.12.6 2012/01/25 18:02:44 riz Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998
@@ -194,6 +194,7 @@ struct rtk_softc {
 #define RTKQ_NOEECMD		0x0080	/* unusable EEPROM command */
 #define RTKQ_MACSTAT		0x0100	/* set MACSTAT_DIS on init */
 #define RTKQ_CMDSTOP		0x0200	/* set STOPREQ on stop */
+#define RTKQ_PHYWAKE_PM		0x0400	/* wake PHY from power down */
 
 	bus_dma_tag_t 		sc_dmat;
 



CVS commit: [netbsd-5] src/sys/dev

2012-01-25 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan 25 18:06:27 UTC 2012

Modified Files:
src/sys/dev [netbsd-5]: fss.c fssvar.h

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1700):
sys/dev/fss.c: revision 1.79
sys/dev/fssvar.h: revision 1.26
Fix FSSIOCSET50: needs to use the 5.0 struct fss_set, not the current one.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.4 -r1.60.4.5 src/sys/dev/fss.c
cvs rdiff -u -r1.23.4.1 -r1.23.4.2 src/sys/dev/fssvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/fss.c
diff -u src/sys/dev/fss.c:1.60.4.4 src/sys/dev/fss.c:1.60.4.5
--- src/sys/dev/fss.c:1.60.4.4	Sat Jun 18 17:00:25 2011
+++ src/sys/dev/fss.c	Wed Jan 25 18:06:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fss.c,v 1.60.4.4 2011/06/18 17:00:25 bouyer Exp $	*/
+/*	$NetBSD: fss.c,v 1.60.4.5 2012/01/25 18:06:26 riz Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.60.4.4 2011/06/18 17:00:25 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: fss.c,v 1.60.4.5 2012/01/25 18:06:26 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -298,11 +298,17 @@ fss_ioctl(dev_t dev, u_long cmd, void *d
 {
 	int error;
 	struct fss_softc *sc = device_lookup_private(fss_cd, minor(dev));
+	struct fss_set _fss;
 	struct fss_set *fss = (struct fss_set *)data;
+	struct fss_set50 *fss50 = (struct fss_set50 *)data;
 	struct fss_get *fsg = (struct fss_get *)data;
 
 	switch (cmd) {
 	case FSSIOCSET50:
+		fss = _fss;
+		fss-fss_mount = fss50-fss_mount;
+		fss-fss_bstore = fss50-fss_bstore;
+		fss-fss_csize = fss50-fss_csize;
 		fss-fss_flags = 0;
 		/* Fall through */
 	case FSSIOCSET:

Index: src/sys/dev/fssvar.h
diff -u src/sys/dev/fssvar.h:1.23.4.1 src/sys/dev/fssvar.h:1.23.4.2
--- src/sys/dev/fssvar.h:1.23.4.1	Sat Jun 18 17:00:25 2011
+++ src/sys/dev/fssvar.h	Wed Jan 25 18:06:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fssvar.h,v 1.23.4.1 2011/06/18 17:00:25 bouyer Exp $	*/
+/*	$NetBSD: fssvar.h,v 1.23.4.2 2012/01/25 18:06:27 riz Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -37,6 +37,12 @@
 #define FSS_UNCONFIG_ON_CLOSE	0x01	/* Unconfigure on last close */
 #define FSS_UNLINK_ON_CREATE	0x02	/* Unlink backing store on create */
 
+struct fss_set50 {
+	char		*fss_mount;	/* Mount point of file system */
+	char		*fss_bstore;	/* Path of backing store */
+	blksize_t	fss_csize;	/* Preferred cluster size */
+};
+
 struct fss_set {
 	char		*fss_mount;	/* Mount point of file system */
 	char		*fss_bstore;	/* Path of backing store */
@@ -57,7 +63,7 @@ struct fss_get {
 #define FSSIOCCLR	_IO('F', 2)			/* Unconfigure */
 #define FSSIOFSET	_IOW('F', 3, int)		/* Set flags */
 #define FSSIOFGET	_IOR('F', 4, int)		/* Get flags */
-#define FSSIOCSET50	_IOW('F', 0, struct fss_set)	/* Old configure */
+#define FSSIOCSET50	_IOW('F', 0, struct fss_set50)	/* Old configure */
 
 #ifdef _KERNEL
 



CVS commit: [netbsd-5] src/sys/dev

2011-12-31 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec 31 22:11:12 UTC 2011

Modified Files:
src/sys/dev [netbsd-5]: vnd.c vndvar.h

Log Message:
Pull up following revision(s) (requested by riz in ticket #1705):
sys/dev/vnd.c: revision 1.218
sys/dev/vndvar.h: revision 1.31
Make vnd(4) work on sparse files:
- Make the strategy decision a device flag and set VNF_USE_VN_RDWR for
  files known to be sparse.
- Change handle_with_rdwr() to use POSIX_FADV_NOREUSE advise to disable
  read ahead and keep the size of mapped pages below 1 MByte.
No objections on tech-kern@.


To generate a diff of this commit:
cvs rdiff -u -r1.187.4.4 -r1.187.4.5 src/sys/dev/vnd.c
cvs rdiff -u -r1.23 -r1.23.10.1 src/sys/dev/vndvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.187.4.4 src/sys/dev/vnd.c:1.187.4.5
--- src/sys/dev/vnd.c:1.187.4.4	Sat Jan 30 19:00:46 2010
+++ src/sys/dev/vnd.c	Sat Dec 31 22:11:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.187.4.4 2010/01/30 19:00:46 snj Exp $	*/
+/*	$NetBSD: vnd.c,v 1.187.4.5 2011/12/31 22:11:12 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.187.4.4 2010/01/30 19:00:46 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.187.4.5 2011/12/31 22:11:12 snj Exp $);
 
 #if defined(_KERNEL_OPT)
 #include fs_nfs.h
@@ -574,7 +574,6 @@ static void
 vndthread(void *arg)
 {
 	struct vnd_softc *vnd = arg;
-	bool usestrategy;
 	int s;
 
 	/* Determine whether we can *use* VOP_BMAP and VOP_STRATEGY to
@@ -582,12 +581,14 @@ vndthread(void *arg)
 	 * operations to avoid messing with the local buffer cache.
 	 * Otherwise fall back to regular VOP_READ/VOP_WRITE operations
 	 * which are guaranteed to work with any file system. */
-	usestrategy = vnode_has_strategy(vnd);
+	if ((vnd-sc_flags  VNF_USE_VN_RDWR) == 0 
+	! vnode_has_strategy(vnd))
+		vnd-sc_flags |= VNF_USE_VN_RDWR;
 
 #ifdef DEBUG
 	if (vnddebug  VDB_INIT)
 		printf(vndthread: vp %p, %s\n, vnd-sc_vp,
-		usestrategy ?
+		(vnd-sc_flags  VNF_USE_VN_RDWR) == 0 ?
 		using bmap/strategy operations :
 		using read/write operations);
 #endif
@@ -669,7 +670,7 @@ vndthread(void *arg)
 		BIO_COPYPRIO(bp, obp);
 
 		/* Handle the request using the appropriate operations. */
-		if (usestrategy)
+		if ((vnd-sc_flags  VNF_USE_VN_RDWR) == 0)
 			handle_with_strategy(vnd, obp, bp);
 		else
 			handle_with_rdwr(vnd, obp, bp);
@@ -721,11 +722,12 @@ handle_with_rdwr(struct vnd_softc *vnd, 
 {
 	bool doread;
 	off_t offset;
-	size_t resid;
+	size_t len, resid;
 	struct vnode *vp;
 
 	doread = bp-b_flags  B_READ;
 	offset = obp-b_rawblkno * vnd-sc_dkdev.dk_label-d_secsize;
+	len = bp-b_bcount;
 	vp = vnd-sc_vp;
 
 #if defined(DEBUG)
@@ -741,10 +743,18 @@ handle_with_rdwr(struct vnd_softc *vnd, 
 	/* Issue the read or write operation. */
 	bp-b_error =
 	vn_rdwr(doread ? UIO_READ : UIO_WRITE,
-	vp, bp-b_data, bp-b_bcount, offset,
-	UIO_SYSSPACE, 0, vnd-sc_cred, resid, NULL);
+	vp, bp-b_data, len, offset, UIO_SYSSPACE,
+	IO_ADV_ENCODE(POSIX_FADV_NOREUSE), vnd-sc_cred, resid, NULL);
 	bp-b_resid = resid;
 
+	/* Keep mapped pages below threshold. */
+	mutex_enter(vp-v_interlock);
+	if (vp-v_uobj.uo_npages  1024*1024 / PAGE_SIZE)
+		(void) VOP_PUTPAGES(vp, 0, 0,
+		PGO_ALLPAGES | PGO_CLEANIT | PGO_FREE | PGO_SYNCIO);
+	else
+		mutex_exit(vp-v_interlock);
+
 	/* We need to increase the number of outputs on the vnode if
 	 * there was any write to it. */
 	if (!doread) {
@@ -1035,6 +1045,9 @@ vndioctl(dev_t dev, u_long cmd, void *da
 		error = VOP_GETATTR(nd.ni_vp, vattr, l-l_cred);
 		if (!error  nd.ni_vp-v_type != VREG)
 			error = EOPNOTSUPP;
+		if (!error  vattr.va_bytes  vattr.va_size)
+			/* File is definitely sparse, use vn_rdwr() */
+			vnd-sc_flags |= VNF_USE_VN_RDWR;
 		if (error) {
 			VOP_UNLOCK(nd.ni_vp, 0);
 			goto close_and_exit;

Index: src/sys/dev/vndvar.h
diff -u src/sys/dev/vndvar.h:1.23 src/sys/dev/vndvar.h:1.23.10.1
--- src/sys/dev/vndvar.h:1.23	Mon Apr 28 20:23:47 2008
+++ src/sys/dev/vndvar.h	Sat Dec 31 22:11:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vndvar.h,v 1.23 2008/04/28 20:23:47 martin Exp $	*/
+/*	$NetBSD: vndvar.h,v 1.23.10.1 2011/12/31 22:11:12 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -176,6 +176,7 @@ struct vnd_softc {
 #define	VNF_KTHREAD	0x100	/* thread is running */
 #define	VNF_VUNCONF	0x200	/* device is unconfiguring */
 #define VNF_COMP	0x400	/* file is compressed */
+#define VNF_USE_VN_RDWR	0x1000	/* have to use vn_rdwr() */
 
 /* structure of header in a compressed file */
 struct vnd_comp_header



CVS commit: [netbsd-5] src/sys/dev/pci

2011-11-18 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Nov 18 23:25:40 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: if_age.c

Log Message:
Pull up the following revisions(s) (requested by bouyer in ticket #1694):
sys/dev/pci/if_age.c:   revision 1.40 via patch

- age_init() is called from age_watchdog() which is in interrupt context; we
can't sleep here or we get a DIAGNOSTIC panic when age_watchdog() fires.
- More correct bus_dma(9) usage in age_encap()
- Introduce a age_shutdown() to be called by pmf(9) at shutdown time,
to stop the DMA engine.
- Be consistent in WAIT/NOWAIT use in init routines
- Use BUS_DMA_COHERENT where appropriate
- Rework the interrupt routine a bit, and ACK but do not disable interrupts
here. There seems to be a race where interrupts would not be properly
reenabled after this, leading do watchdog timeouts.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.5 -r1.28.2.6 src/sys/dev/pci/if_age.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_age.c
diff -u src/sys/dev/pci/if_age.c:1.28.2.5 src/sys/dev/pci/if_age.c:1.28.2.6
--- src/sys/dev/pci/if_age.c:1.28.2.5	Sun Nov  8 22:03:32 2009
+++ src/sys/dev/pci/if_age.c	Fri Nov 18 23:25:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.28.2.5 2009/11/08 22:03:32 snj Exp $ */
+/*	$NetBSD: if_age.c,v 1.28.2.6 2011/11/18 23:25:40 sborrill Exp $ */
 /*	$OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $	*/
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_age.c,v 1.28.2.5 2009/11/08 22:03:32 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_age.c,v 1.28.2.6 2011/11/18 23:25:40 sborrill Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -93,6 +93,7 @@ static int	age_init(struct ifnet *);
 static int	age_ioctl(struct ifnet *, u_long, void *);
 static void	age_start(struct ifnet *);
 static void	age_watchdog(struct ifnet *);
+static bool	age_shutdown(device_t, int);
 static void	age_mediastatus(struct ifnet *, struct ifmediareq *);
 static int	age_mediachange(struct ifnet *);
 
@@ -287,7 +288,7 @@ age_attach(device_t parent, device_t sel
 	if_attach(ifp);
 	ether_ifattach(ifp, sc-sc_enaddr);
 
-	if (!pmf_device_register(self, NULL, age_resume))
+	if (!pmf_device_register1(self, NULL, age_resume, age_shutdown))
 		aprint_error_dev(self, couldn't establish power handler\n);
 	else
 		pmf_class_network_register(self, ifp);
@@ -495,65 +496,61 @@ age_intr(void *arg)
 	cmb = sc-age_rdata.age_cmb_block;
 	if (cmb == NULL) {
 		/* Happens when bringing up the interface
-		 * w/o having a carrier. Ack. the interrupt.
+		 * w/o having a carrier. Ack the interrupt.
 		 */
 		CSR_WRITE_4(sc, AGE_INTR_STATUS, status);
 		return 0;
 	}
 
-	/* Disable interrupts. */
-	CSR_WRITE_4(sc, AGE_INTR_STATUS, status | INTR_DIS_INT);
-		
-	bus_dmamap_sync(sc-sc_dmat, sc-age_cdata.age_cmb_block_map, 0,
-	sc-age_cdata.age_cmb_block_map-dm_mapsize, BUS_DMASYNC_POSTREAD);
-	status = le32toh(cmb-intr_status);
-	if ((status  AGE_INTRS) == 0)
-		goto back;
-
-	sc-age_tpd_cons = (le32toh(cmb-tpd_cons)  TPD_CONS_MASK) 
-	TPD_CONS_SHIFT;
-	sc-age_rr_prod = (le32toh(cmb-rprod_cons)  RRD_PROD_MASK) 
-	RRD_PROD_SHIFT;
-
-	/* Let hardware know CMB was served. */
-	cmb-intr_status = 0;
 	bus_dmamap_sync(sc-sc_dmat, sc-age_cdata.age_cmb_block_map, 0,
 	sc-age_cdata.age_cmb_block_map-dm_mapsize,
-	BUS_DMASYNC_PREWRITE);
-
-	if (ifp-if_flags  IFF_RUNNING) {
-		if (status  INTR_CMB_RX)
-			age_rxintr(sc, sc-age_rr_prod);
-
-		if (status  INTR_CMB_TX)
-			age_txintr(sc, sc-age_tpd_cons);
-
-		if (status  (INTR_DMA_RD_TO_RST | INTR_DMA_WR_TO_RST)) {
-			if (status  INTR_DMA_RD_TO_RST)
-printf(%s: DMA read error! -- resetting\n,
-device_xname(sc-sc_dev));
-			if (status  INTR_DMA_WR_TO_RST)
-printf(%s: DMA write error! -- resetting\n,
-device_xname(sc-sc_dev));
-			age_init(ifp);
-		}
+	BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+	status = le32toh(cmb-intr_status);
+	/* ACK/reenable interrupts */
+	CSR_WRITE_4(sc, AGE_INTR_STATUS, status);
+	while ((status  AGE_INTRS) != 0) {
+		sc-age_tpd_cons = (le32toh(cmb-tpd_cons)  TPD_CONS_MASK) 
+		TPD_CONS_SHIFT;
+		sc-age_rr_prod = (le32toh(cmb-rprod_cons)  RRD_PROD_MASK) 
+		RRD_PROD_SHIFT;
+
+		/* Let hardware know CMB was served. */
+		cmb-intr_status = 0;
+		bus_dmamap_sync(sc-sc_dmat, sc-age_cdata.age_cmb_block_map, 0,
+		sc-age_cdata.age_cmb_block_map-dm_mapsize,
+		BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+
+		if (ifp-if_flags  IFF_RUNNING) {
+			if (status  INTR_CMB_RX)
+age_rxintr(sc, sc-age_rr_prod);
+
+			if (status  INTR_CMB_TX)
+age_txintr(sc, sc-age_tpd_cons);
+
+			if (status  (INTR_DMA_RD_TO_RST | INTR_DMA_WR_TO_RST)) {
+if (status  INTR_DMA_RD_TO_RST)
+	printf(%s: DMA read error! -- 
+	resetting\n,
+

CVS commit: [netbsd-5] src/sys/dev/ic

2011-11-02 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Nov  2 19:39:43 UTC 2011

Modified Files:
src/sys/dev/ic [netbsd-5]: ciss.c

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #1674):
sys/dev/ic/ciss.c: revision 1.25
I was allowing adapt_max_periph to use all available command slots, which
easily exceeds the maximum of 256 tags used by the scsipi layer because
the tag information from the scsipi layer was ignored and all the tagging
is handled implicitly internal to ciss(4).  But with the DIAGNOSTIC option,
the scsipi layer does a check for  256 tags and will panic.  So, lets just
limit the adapt_max_periph to 256 so the scsipi layer won't try to user more.


To generate a diff of this commit:
cvs rdiff -u -r1.14.4.2 -r1.14.4.3 src/sys/dev/ic/ciss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ciss.c
diff -u src/sys/dev/ic/ciss.c:1.14.4.2 src/sys/dev/ic/ciss.c:1.14.4.3
--- src/sys/dev/ic/ciss.c:1.14.4.2	Sun Nov 21 21:02:49 2010
+++ src/sys/dev/ic/ciss.c	Wed Nov  2 19:39:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss.c,v 1.14.4.2 2010/11/21 21:02:49 riz Exp $	*/
+/*	$NetBSD: ciss.c,v 1.14.4.3 2011/11/02 19:39:43 riz Exp $	*/
 /*	$OpenBSD: ciss.c,v 1.14 2006/03/13 16:02:23 mickey Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ciss.c,v 1.14.4.2 2010/11/21 21:02:49 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: ciss.c,v 1.14.4.3 2011/11/02 19:39:43 riz Exp $);
 
 #include bio.h
 
@@ -375,7 +375,7 @@ ciss_attach(struct ciss_softc *sc)
 
 	sc-sc_adapter.adapt_dev = (struct device *) sc;
 	sc-sc_adapter.adapt_openings = sc-sc_channel.chan_openings;
-	sc-sc_adapter.adapt_max_periph = sc-sc_channel.chan_openings;
+	sc-sc_adapter.adapt_max_periph = min(sc-sc_adapter.adapt_openings, 256);
 	sc-sc_adapter.adapt_request = ciss_scsi_cmd;
 	sc-sc_adapter.adapt_minphys = cissminphys;
 	sc-sc_adapter.adapt_ioctl = ciss_scsi_ioctl;



CVS commit: [netbsd-5] src/sys/dev/usb

2011-08-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Aug 19 19:45:40 UTC 2011

Modified Files:
src/sys/dev/usb [netbsd-5]: ohci.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1663):
sys/dev/usb/ohci.c: patch
Fix the build problem introduced by pullup ticket #1655.


To generate a diff of this commit:
cvs rdiff -u -r1.196.4.1 -r1.196.4.2 src/sys/dev/usb/ohci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.196.4.1 src/sys/dev/usb/ohci.c:1.196.4.2
--- src/sys/dev/usb/ohci.c:1.196.4.1	Fri Aug 12 20:52:25 2011
+++ src/sys/dev/usb/ohci.c	Fri Aug 19 19:45:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.196.4.1 2011/08/12 20:52:25 riz Exp $	*/
+/*	$NetBSD: ohci.c,v 1.196.4.2 2011/08/19 19:45:39 riz Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.196.4.1 2011/08/12 20:52:25 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.196.4.2 2011/08/19 19:45:39 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1330,8 +1330,8 @@
 			DPRINTFN(5,(add ITD %p\n, sitd));
 			continue;
 		}
-		device_printf(sc-sc_dev, WARNING: addr 0x%08lx not found\n,
-		(u_long)done);
+		printf(%s: WARNING: addr 0x%08lx not found\n,
+		device_xname(sc-sc_dev), (u_long)done);
 		break;
 	}
 



CVS commit: [netbsd-5] src/sys/dev/usb

2011-08-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Aug 12 20:52:25 UTC 2011

Modified Files:
src/sys/dev/usb [netbsd-5]: ohci.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1655):
sys/dev/usb/ohci.c: revision 1.218
PR# kern/30398: panic in ohci_softintr
If the host controller has a TD that the driver doesn't know about, ignore it
instead of calling panic. Patch from Karl Janmar.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.196.4.1 src/sys/dev/usb/ohci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.196 src/sys/dev/usb/ohci.c:1.196.4.1
--- src/sys/dev/usb/ohci.c:1.196	Wed Aug 13 09:43:56 2008
+++ src/sys/dev/usb/ohci.c	Fri Aug 12 20:52:25 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.196 2008/08/13 09:43:56 drochner Exp $	*/
+/*	$NetBSD: ohci.c,v 1.196.4.1 2011/08/12 20:52:25 riz Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.196 2008/08/13 09:43:56 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.196.4.1 2011/08/12 20:52:25 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1330,7 +1330,9 @@
 			DPRINTFN(5,(add ITD %p\n, sitd));
 			continue;
 		}
-		panic(ohci_softintr: addr 0x%08lx not found, (u_long)done);
+		device_printf(sc-sc_dev, WARNING: addr 0x%08lx not found\n,
+		(u_long)done);
+		break;
 	}
 
 	DPRINTFN(10,(ohci_softintr: sdone=%p sidone=%p\n, sdone, sidone));



CVS commit: [netbsd-5] src/sys/dev/isa

2011-06-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jun 18 16:24:10 UTC 2011

Modified Files:
src/sys/dev/isa [netbsd-5]: pcppi.c pcppivar.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1625):
sys/dev/isa/pcppivar.h: revision 1.10
sys/dev/isa/pcppi.c: revision 1.36
convert a lockless + spltty() combo to a IPL_VM mutex and cv.
hopefully this will avoid the beep-didn't-stop problem i had recently
that i was able to fix by calling wakeup() on pcppi's softc from ddb.


To generate a diff of this commit:
cvs rdiff -u -r1.32.14.1 -r1.32.14.2 src/sys/dev/isa/pcppi.c
cvs rdiff -u -r1.9 -r1.9.14.1 src/sys/dev/isa/pcppivar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/pcppi.c
diff -u src/sys/dev/isa/pcppi.c:1.32.14.1 src/sys/dev/isa/pcppi.c:1.32.14.2
--- src/sys/dev/isa/pcppi.c:1.32.14.1	Sat Nov 20 17:41:27 2010
+++ src/sys/dev/isa/pcppi.c	Sat Jun 18 16:24:10 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pcppi.c,v 1.32.14.1 2010/11/20 17:41:27 riz Exp $ */
+/* $NetBSD: pcppi.c,v 1.32.14.2 2011/06/18 16:24:10 bouyer Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pcppi.c,v 1.32.14.1 2010/11/20 17:41:27 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: pcppi.c,v 1.32.14.2 2011/06/18 16:24:10 bouyer Exp $);
 
 #include attimer.h
 
@@ -39,8 +39,9 @@
 #include sys/proc.h
 #include sys/device.h
 #include sys/errno.h
-
 #include sys/bus.h
+#include sys/mutex.h
+#include sys/condvar.h
 
 #include dev/ic/attimervar.h
 
@@ -193,6 +194,10 @@
 	callout_stop(sc-sc_bell_ch);
 	callout_destroy(sc-sc_bell_ch);
 	bus_space_unmap(sc-sc_iot, sc-sc_ppi_ioh, sc-sc_size);
+
+	mutex_destroy(sc-sc_lock);
+	cv_destroy(sc-sc_stop_cv);
+
 	return 0;
 }
 
@@ -206,6 +211,9 @@
 
 sc-sc_bellactive = sc-sc_bellpitch = sc-sc_slp = 0;
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_VM);
+	cv_init(sc-sc_stop_cv, bell);
+
 #if NPCKBD  0
 	/* Provide a beeper for the PC Keyboard, if there isn't one already. */
 	pckbd_hookup_bell(pcppi_pckbd_bell, sc);
@@ -251,21 +259,20 @@
 pcppi_bell(pcppi_tag_t self, int pitch, int period, int slp)
 {
 	struct pcppi_softc *sc = self;
-	int s;
 
-	s = spltty(); /* ??? */
+	mutex_enter(sc-sc_lock);
 	if (sc-sc_bellactive) {
 		if (sc-sc_timeout) {
 			sc-sc_timeout = 0;
 			callout_stop(sc-sc_bell_ch);
 		}
 		if (sc-sc_slp)
-			wakeup(pcppi_bell_stop);
+			cv_broadcast(sc-sc_stop_cv);
 	}
 	if (pitch == 0 || period == 0) {
 		pcppi_bell_stop(sc);
 		sc-sc_bellpitch = 0;
-		splx(s);
+		mutex_exit(sc-sc_lock);
 		return;
 	}
 	if (!sc-sc_bellactive || sc-sc_bellpitch != pitch) {
@@ -289,20 +296,19 @@
 		callout_reset(sc-sc_bell_ch, period, pcppi_bell_stop, sc);
 		if (slp  PCPPI_BELL_SLEEP) {
 			sc-sc_slp = 1;
-			tsleep(pcppi_bell_stop, PCPPIPRI | PCATCH, bell, 0);
+			cv_wait_sig(sc-sc_stop_cv, sc-sc_lock);
 			sc-sc_slp = 0;
 		}
 	}
-	splx(s);
+	mutex_exit(sc-sc_lock);
 }
 
 static void
 pcppi_bell_stop(void *arg)
 {
 	struct pcppi_softc *sc = arg;
-	int s;
 
-	s = spltty(); /* ??? */
+	mutex_enter(sc-sc_lock);
 	sc-sc_timeout = 0;
 
 	/* disable bell */
@@ -311,8 +317,8 @@
 			   ~PIT_SPKR);
 	sc-sc_bellactive = 0;
 	if (sc-sc_slp)
-		wakeup(pcppi_bell_stop);
-	splx(s);
+		cv_broadcast(sc-sc_stop_cv);
+	mutex_exit(sc-sc_lock);
 }
 
 #if NPCKBD  0

Index: src/sys/dev/isa/pcppivar.h
diff -u src/sys/dev/isa/pcppivar.h:1.9 src/sys/dev/isa/pcppivar.h:1.9.14.1
--- src/sys/dev/isa/pcppivar.h:1.9	Tue Mar  4 16:35:19 2008
+++ src/sys/dev/isa/pcppivar.h	Sat Jun 18 16:24:10 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pcppivar.h,v 1.9 2008/03/04 16:35:19 cube Exp $ */
+/* $NetBSD: pcppivar.h,v 1.9.14.1 2011/06/18 16:24:10 bouyer Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -37,18 +37,21 @@
 };
 
 struct pcppi_softc {
-device_t sc_dv;  
+	device_t sc_dv;  
 
-bus_space_tag_t sc_iot;
-bus_space_handle_t sc_ppi_ioh;
-bus_size_t sc_size;
-device_t sc_timer;
+	bus_space_tag_t sc_iot;
+	bus_space_handle_t sc_ppi_ioh;
+	bus_size_t sc_size;
+	device_t sc_timer;
 
-struct callout sc_bell_ch;
+	struct callout sc_bell_ch;
 
-int sc_bellactive, sc_bellpitch;
-int sc_slp;
-int sc_timeout;
+	int sc_bellactive, sc_bellpitch;
+	int sc_slp;
+	int sc_timeout;
+
+	kmutex_t sc_lock;
+	kcondvar_t sc_stop_cv;
 };
 
 void pcppi_attach(struct pcppi_softc *);



CVS commit: [netbsd-5] src/sys/dev/ic

2011-06-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jun 18 16:40:31 UTC 2011

Modified Files:
src/sys/dev/ic [netbsd-5]: gem.c

Log Message:
Pull up following revision(s) (requested by jdc in ticket #1632):
sys/dev/ic/gem.c: revision 1.97
Fix corrupted packet problem on 100Mb/s half duplex links.
We need to set echo disable on the internal phy too, not just on the
external phy.
Tested on:
SUNW,Sun-Blade-2000
gem0 at pci0 dev 5 function 1: Sun Microsystems ERI Ethernet (rev. 0x01)
ukphy0 at gem0 phy 1: OUI 0x0006b8, model 0x000c, rev. 1
Setting pointed out by bad@.


To generate a diff of this commit:
cvs rdiff -u -r1.78.4.1 -r1.78.4.2 src/sys/dev/ic/gem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/gem.c
diff -u src/sys/dev/ic/gem.c:1.78.4.1 src/sys/dev/ic/gem.c:1.78.4.2
--- src/sys/dev/ic/gem.c:1.78.4.1	Fri May  1 01:56:16 2009
+++ src/sys/dev/ic/gem.c	Sat Jun 18 16:40:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gem.c,v 1.78.4.1 2009/05/01 01:56:16 snj Exp $ */
+/*	$NetBSD: gem.c,v 1.78.4.2 2011/06/18 16:40:31 bouyer Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.78.4.1 2009/05/01 01:56:16 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.78.4.2 2011/06/18 16:40:31 bouyer Exp $);
 
 #include opt_inet.h
 #include bpfilter.h
@@ -2385,14 +2385,6 @@
 	sc-sc_mif_config = bus_space_read_4(t, mac, GEM_MIF_CONFIG);
 	if ((sc-sc_flags (GEM_SERDES | GEM_SERIAL)) == 0) {
 		if ((sc-sc_mif_config  GEM_MIF_CONFIG_MDI1) != 0) {
-			/* External MII needs echo disable if half duplex. */
-			if ((IFM_OPTIONS(sc-sc_mii.mii_media_active) 
-			IFM_FDX) != 0)
-/* turn on full duplex LED */
-v |= GEM_MAC_XIF_FDPLX_LED;
-			else
-/* half duplex -- disable echo */
-v |= GEM_MAC_XIF_ECHO_DISABL;
 			if (gigabit)
 v |= GEM_MAC_XIF_GMII_MODE;
 			else
@@ -2400,6 +2392,13 @@
 		} else
 			/* Internal MII needs buf enable */
 			v |= GEM_MAC_XIF_MII_BUF_ENA;
+		/* MII needs echo disable if half duplex. */
+		if ((IFM_OPTIONS(sc-sc_mii.mii_media_active)  IFM_FDX) != 0)
+			/* turn on full duplex LED */
+			v |= GEM_MAC_XIF_FDPLX_LED;
+		else
+			/* half duplex -- disable echo */
+			v |= GEM_MAC_XIF_ECHO_DISABL;
 	} else {
 		if ((IFM_OPTIONS(sc-sc_mii.mii_media_active)  IFM_FDX) != 0)
 			v |= GEM_MAC_XIF_FDPLX_LED;



CVS commit: [netbsd-5] src/sys/dev/isa

2011-06-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jun 18 22:47:20 UTC 2011

Modified Files:
src/sys/dev/isa [netbsd-5]: pcppi.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1625):
sys/dev/isa/pcppi.c: revision 1.37
avoid mutex locking botch and introduce an unlocked version of
pcppi_bell_stop().  fixes a problem reported in private email.


To generate a diff of this commit:
cvs rdiff -u -r1.32.14.2 -r1.32.14.3 src/sys/dev/isa/pcppi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/pcppi.c
diff -u src/sys/dev/isa/pcppi.c:1.32.14.2 src/sys/dev/isa/pcppi.c:1.32.14.3
--- src/sys/dev/isa/pcppi.c:1.32.14.2	Sat Jun 18 16:24:10 2011
+++ src/sys/dev/isa/pcppi.c	Sat Jun 18 22:47:20 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pcppi.c,v 1.32.14.2 2011/06/18 16:24:10 bouyer Exp $ */
+/* $NetBSD: pcppi.c,v 1.32.14.3 2011/06/18 22:47:20 bouyer Exp $ */
 
 /*
  * Copyright (c) 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pcppi.c,v 1.32.14.2 2011/06/18 16:24:10 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: pcppi.c,v 1.32.14.3 2011/06/18 22:47:20 bouyer Exp $);
 
 #include attimer.h
 
@@ -65,6 +65,7 @@
 pcppi_match, pcppi_isa_attach, pcppi_detach, NULL, NULL, pcppi_childdet);
 
 static int pcppisearch(device_t, cfdata_t, const int *, void *);
+static void pcppi_bell_stop_unlocked(void*);
 static void pcppi_bell_stop(void*);
 
 #if NATTIMER  0
@@ -270,7 +271,7 @@
 			cv_broadcast(sc-sc_stop_cv);
 	}
 	if (pitch == 0 || period == 0) {
-		pcppi_bell_stop(sc);
+		pcppi_bell_stop_unlocked(sc);
 		sc-sc_bellpitch = 0;
 		mutex_exit(sc-sc_lock);
 		return;
@@ -290,7 +291,7 @@
 	sc-sc_bellactive = 1;
 	if (slp  PCPPI_BELL_POLL) {
 		delay((period * 100) / hz);
-		pcppi_bell_stop(sc);
+		pcppi_bell_stop_unlocked(sc);
 	} else {
 		sc-sc_timeout = 1;
 		callout_reset(sc-sc_bell_ch, period, pcppi_bell_stop, sc);
@@ -304,11 +305,10 @@
 }
 
 static void
-pcppi_bell_stop(void *arg)
+pcppi_bell_stop_unlocked(void *arg)
 {
 	struct pcppi_softc *sc = arg;
 
-	mutex_enter(sc-sc_lock);
 	sc-sc_timeout = 0;
 
 	/* disable bell */
@@ -318,6 +318,15 @@
 	sc-sc_bellactive = 0;
 	if (sc-sc_slp)
 		cv_broadcast(sc-sc_stop_cv);
+}
+
+static void
+pcppi_bell_stop(void *arg)
+{
+	struct pcppi_softc *sc = arg;
+
+	mutex_enter(sc-sc_lock);
+	pcppi_bell_stop_unlocked(arg);
 	mutex_exit(sc-sc_lock);
 }
 



CVS commit: [netbsd-5] src/sys/dev/pci

2011-05-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May 20 19:19:57 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: if_lii.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1612):
sys/dev/pci/if_lii.c: revision 1.10
PR/41258: Elias Benali: Try to get the ethernet address from the BIOS before
failing.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.4.1 src/sys/dev/pci/if_lii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_lii.c
diff -u src/sys/dev/pci/if_lii.c:1.5 src/sys/dev/pci/if_lii.c:1.5.4.1
--- src/sys/dev/pci/if_lii.c:1.5	Tue Jul  8 12:39:27 2008
+++ src/sys/dev/pci/if_lii.c	Fri May 20 19:19:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_lii.c,v 1.5 2008/07/08 12:39:27 sborrill Exp $	*/
+/*	$NetBSD: if_lii.c,v 1.5.4.1 2011/05/20 19:19:57 bouyer Exp $	*/
 
 /*
  *  Copyright (c) 2008 The NetBSD Foundation.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_lii.c,v 1.5 2008/07/08 12:39:27 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_lii.c,v 1.5.4.1 2011/05/20 19:19:57 bouyer Exp $);
 
 #include bpfilter.h
 
@@ -547,17 +547,18 @@
 	}
 
 	if (found  2) {
-		aprint_error_dev(sc-sc_dev, error reading MAC address\n);
-		return 1;
-	}
-
-	addr0 = htole32(addr0);
-	addr1 = htole32(addr1);
-
-	if ((addr0 == 0xff  (addr1  0x) == 0x) ||
-	(addr0 == 0  (addr1  0x) == 0)) {
+		/* Make sure we try the BIOS method before giving up */
 		addr0 = htole32(AT_READ_4(sc, ATL2_MAC_ADDR_0));
 		addr1 = htole32(AT_READ_4(sc, ATL2_MAC_ADDR_1));
+		if ((addr0 == 0xff  (addr1  0x) == 0x) ||
+		(addr0 == 0  (addr1  0x) == 0)) {
+			aprint_error_dev(sc-sc_dev,
+			error reading MAC address\n);
+			return 1;
+		}
+	} else {
+		addr0 = htole32(addr0);
+		addr1 = htole32(addr1);
 	}
 
 	ea[0] = (addr1  0xff00)  8;



CVS commit: [netbsd-5] src/sys/dev/raidframe

2011-05-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May 20 19:24:54 UTC 2011

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_netbsdkintf.c

Log Message:
Pull up following revision(s) (requested by buhrow in ticket #1615):
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.280 via patch
PR/44340: Brian Buhrow: Raid sets containing wedges cannot be unconfigured
and reconfigured without a reboot.


To generate a diff of this commit:
cvs rdiff -u -r1.250.4.10 -r1.250.4.11 src/sys/dev/raidframe/rf_netbsdkintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.10 src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.11
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.10	Fri Jan  7 23:27:51 2011
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Fri May 20 19:24:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.10 2011/01/07 23:27:51 riz Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.11 2011/05/20 19:24:54 bouyer Exp $	*/
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -139,7 +139,7 @@
  ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.10 2011/01/07 23:27:51 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.11 2011/05/20 19:24:54 bouyer Exp $);
 
 #include sys/param.h
 #include sys/errno.h
@@ -851,6 +851,7 @@
 			free(cf, M_RAIDFRAME);
 			
 			/* Detach the disk. */
+			dkwedge_delall(rs-sc_dkdev);
 			disk_detach(rs-sc_dkdev);
 			disk_destroy(rs-sc_dkdev);
 		}
@@ -1201,6 +1202,7 @@
 		free(cf, M_RAIDFRAME);
 
 		/* Detach the disk. */
+		dkwedge_delall(rs-sc_dkdev);
 		disk_detach(rs-sc_dkdev);
 		disk_destroy(rs-sc_dkdev);
 



CVS commit: [netbsd-5] src/sys/dev/usb

2011-05-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May 20 19:31:47 UTC 2011

Modified Files:
src/sys/dev/usb [netbsd-5]: ehci.c

Log Message:
Pull up following revision(s) (requested by drochner in ticket #1620):
sys/dev/usb/ehci.c: revision 1.174
in alloc_sqtd_chain(), deal with the case where a data packet ends
exactly at a page boundary, and the FORCE_SHORT_XFER was set by the
client (which causes that an empty descriptor is needed to terminate
the transfer), from Gordon McNutt per PR kern/44883
(fixed a bit differently than the proposed patch for aesthetical
reasons -- avoids the page pointer to come into unexpexted area earlier)


To generate a diff of this commit:
cvs rdiff -u -r1.154.4.2 -r1.154.4.3 src/sys/dev/usb/ehci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.154.4.2 src/sys/dev/usb/ehci.c:1.154.4.3
--- src/sys/dev/usb/ehci.c:1.154.4.2	Sat Jun 12 01:05:44 2010
+++ src/sys/dev/usb/ehci.c	Fri May 20 19:31:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.154.4.2 2010/06/12 01:05:44 riz Exp $ */
+/*	$NetBSD: ehci.c,v 1.154.4.3 2011/05/20 19:31:46 bouyer Exp $ */
 
 /*
  * Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.154.4.2 2010/06/12 01:05:44 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.154.4.3 2011/05/20 19:31:46 bouyer Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -2706,7 +2706,8 @@
 		usb_syncmem(cur-dma, cur-offs, sizeof(cur-qtd),
 		BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 		DPRINTFN(10,(ehci_alloc_sqtd_chain: extend chain\n));
-		dataphys += curlen;
+		if (len)
+			dataphys += curlen;
 		cur = next;
 	}
 	cur-qtd.qtd_status |= htole32(EHCI_QTD_IOC);



CVS commit: [netbsd-5] src/sys/dev/pci

2011-04-24 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 24 16:27:25 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: if_bge.c

Log Message:
Pull up following revision(s) (requested by buhrow in ticket #1601):
sys/dev/pci/if_bge.c: revision 1.194
Fixes for kern/40018.
Our driver initializes the Broadcom hardware to peform a tcp and udp
checksum on only the payload of the tcp or udp packet, rather than the
entire packet.  The FreeBSD, OpenBSD  and Linux drivers instruct the hardware
to compute
the checksum for the entire packet.  I believe the bug is that some revisions
of the BCM hardware, under certain circumstances, revert to doing the
complete checksum calculation, as the FreeBSD, OpenBSD  and Linux drivers
request, while things are running. As
a result, when we pull the computed checksum from the hardware and pass it
up to the upper layers, we assume the checksum is the more minimal
one, and the upper layers perform the appropriate checks, which, when this
happens, cause the packet to be rejected because the resultant checksum is
decidedly incorrect.
This patch changes the driver to instruct the hardware to perform the
checksum over the entire packet, just as the FreeBSD, OpenBSD  and
Linux drivers do, and to notify the upper layers appropriately.
This patch appears to work on all revisions of the hardware that have been
tested.  (See the list in the bug report.)
this patch is approved by tls.


To generate a diff of this commit:
cvs rdiff -u -r1.152.4.5 -r1.152.4.6 src/sys/dev/pci/if_bge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.152.4.5 src/sys/dev/pci/if_bge.c:1.152.4.6
--- src/sys/dev/pci/if_bge.c:1.152.4.5	Fri Nov 19 23:58:40 2010
+++ src/sys/dev/pci/if_bge.c	Sun Apr 24 16:27:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.152.4.5 2010/11/19 23:58:40 riz Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.152.4.6 2011/04/24 16:27:24 riz Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.152.4.5 2010/11/19 23:58:40 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.152.4.6 2011/04/24 16:27:24 riz Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -1870,7 +1870,7 @@
 	 */
 	CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS |
 	BGE_MODECTL_MAC_ATTN_INTR | BGE_MODECTL_HOST_SEND_BDS |
-	BGE_MODECTL_TX_NO_PHDR_CSUM | BGE_MODECTL_RX_NO_PHDR_CSUM);
+	BGE_MODECTL_TX_NO_PHDR_CSUM);
 
 	/*
 	 * BCM5701 B5 have a bug causing data corruption when using
@@ -3451,7 +3451,7 @@
 			cur_rx-bge_tcp_udp_csum;
 			m-m_pkthdr.csum_flags |=
 			(M_CSUM_TCPv4|M_CSUM_UDPv4|
-			 M_CSUM_DATA|M_CSUM_NO_PSEUDOHDR);
+			 M_CSUM_DATA);
 		}
 
 		/*



CVS commit: [netbsd-5] src/sys/dev/pci

2011-04-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Apr  5 06:12:46 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: if_jme.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1588):
sys/dev/pci/if_jme.c: revision 1.17
Some bus_dma(9)-related and memory allocation fixes:
- always bus_dmamap_unload() before recycling a receive descriptor
- make sure to not sleep from interrupt context: call bus_dmamap_load with
  M_NOWAIT, and create dma maps BUS_DMA_ALLOCNOW.
- if a receive descriptor has a NULL mbuf try to allocate a new one, don't
  try to receive it.


To generate a diff of this commit:
cvs rdiff -u -r1.4.6.3 -r1.4.6.4 src/sys/dev/pci/if_jme.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_jme.c
diff -u src/sys/dev/pci/if_jme.c:1.4.6.3 src/sys/dev/pci/if_jme.c:1.4.6.4
--- src/sys/dev/pci/if_jme.c:1.4.6.3	Sun Jan 16 12:51:59 2011
+++ src/sys/dev/pci/if_jme.c	Tue Apr  5 06:12:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_jme.c,v 1.4.6.3 2011/01/16 12:51:59 bouyer Exp $	*/
+/*	$NetBSD: if_jme.c,v 1.4.6.4 2011/04/05 06:12:46 riz Exp $	*/
 
 /*
  * Copyright (c) 2008 Manuel Bouyer.  All rights reserved.
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_jme.c,v 1.4.6.3 2011/01/16 12:51:59 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_jme.c,v 1.4.6.4 2011/04/05 06:12:46 riz Exp $);
 
 
 #include sys/param.h
@@ -447,13 +447,14 @@
 	for (i = 0; i  JME_NBUFS; i++) {
 		sc-jme_txmbuf[i] = sc-jme_rxmbuf[i] = NULL;
 		if (bus_dmamap_create(sc-jme_dmatag, JME_MAX_TX_LEN,
-		JME_NBUFS, JME_MAX_TX_LEN, 0, BUS_DMA_NOWAIT,
+		JME_NBUFS, JME_MAX_TX_LEN, 0,
+		BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
 		sc-jme_txmbufm[i]) != 0) {
 			aprint_error_dev(self, can't allocate DMA TX map\n);
 			return;
 		}
 		if (bus_dmamap_create(sc-jme_dmatag, JME_MAX_RX_LEN,
-		1, JME_MAX_RX_LEN, 0, BUS_DMA_NOWAIT,
+		1, JME_MAX_RX_LEN, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
 		sc-jme_rxmbufm[i]) != 0) {
 			aprint_error_dev(self, can't allocate DMA RX map\n);
 			return;
@@ -705,6 +706,8 @@
 	}
 	map = sc-jme_rxmbufm[i];
 	m-m_len = m-m_pkthdr.len = m-m_ext.ext_size;
+	KASSERT(m-m_len == MCLBYTES);
+
 	error = bus_dmamap_load_mbuf(sc-jme_dmatag, map, m,
 	BUS_DMA_READ|BUS_DMA_NOWAIT);
 	if (error) {
@@ -1050,6 +1053,7 @@
 static void
 jme_intr_rx(jme_softc_t *sc) {
 	struct mbuf *m, *mhead;
+	bus_dmamap_t mmap;
 	struct ifnet *ifp = sc-jme_if;
 	uint32_t flags,  buflen;
 	int i, ipackets, nsegs, seg, error;
@@ -1063,7 +1067,7 @@
 	sc-jme_rx_cons, le32toh(sc-jme_rxring[sc-jme_rx_cons].flags));
 #endif
 	ipackets = 0;
-	while((le32toh(sc-jme_rxring[ sc-jme_rx_cons].flags)  JME_RD_OWN)
+	while((le32toh(sc-jme_rxring[sc-jme_rx_cons].flags)  JME_RD_OWN)
 	== 0) {
 		i = sc-jme_rx_cons;
 		desc = sc-jme_rxring[i];
@@ -1071,11 +1075,19 @@
 		printf(rxintr i %d flags 0x%x buflen 0x%x\n,
 		i,  le32toh(desc-flags), le32toh(desc-buflen));
 #endif
+		if (sc-jme_rxmbuf[i] == NULL) {
+			if ((error = jme_add_rxbuf(sc, NULL)) != 0) {
+aprint_error_dev(sc-jme_dev,
+can't add new mbuf to empty slot: %d\n,
+error);
+break;
+			}
+			JME_DESC_INC(sc-jme_rx_cons, JME_NBUFS);
+			i = sc-jme_rx_cons;
+			continue;
+		}
 		if ((le32toh(desc-buflen)  JME_RD_VALID) == 0)
 			break;
-		bus_dmamap_sync(sc-jme_dmatag, sc-jme_rxmbufm[i], 0,
-		sc-jme_rxmbufm[i]-dm_mapsize, BUS_DMASYNC_POSTREAD);
-		bus_dmamap_unload(sc-jme_dmatag, sc-jme_rxmbufm[i]);
 
 		buflen = le32toh(desc-buflen);
 		nsegs = JME_RX_NSEGS(buflen);
@@ -1093,6 +1105,10 @@
 			for (seg = 0; seg  nsegs; seg++) {
 m = sc-jme_rxmbuf[i];
 sc-jme_rxmbuf[i] = NULL;
+mmap = sc-jme_rxmbufm[i];
+bus_dmamap_sync(sc-jme_dmatag, mmap, 0,
+mmap-dm_mapsize, BUS_DMASYNC_POSTREAD);
+bus_dmamap_unload(sc-jme_dmatag, mmap);
 if ((error = jme_add_rxbuf(sc, m)) != 0)
 	aprint_error_dev(sc-jme_dev,
 	can't reuse mbuf: %d\n, error);
@@ -1104,11 +1120,24 @@
 		/* receive this packet */
 		mhead = m = sc-jme_rxmbuf[i];
 		sc-jme_rxmbuf[i] = NULL;
+		mmap = sc-jme_rxmbufm[i];
+		bus_dmamap_sync(sc-jme_dmatag, mmap, 0,
+		mmap-dm_mapsize, BUS_DMASYNC_POSTREAD);
+		bus_dmamap_unload(sc-jme_dmatag, mmap);
 		/* add a new buffer to chain */
-		if (jme_add_rxbuf(sc, NULL) == ENOBUFS) {
-			for (seg = 0; seg  nsegs; seg++) {
+		if (jme_add_rxbuf(sc, NULL) != 0) {
+			if ((error = jme_add_rxbuf(sc, m)) != 0)
+aprint_error_dev(sc-jme_dev,
+can't reuse mbuf: %d\n, error);
+			JME_DESC_INC(sc-jme_rx_cons, JME_NBUFS);
+			i = sc-jme_rx_cons;
+			for (seg = 1; seg  nsegs; seg++) {
 m = sc-jme_rxmbuf[i];
 sc-jme_rxmbuf[i] = NULL;
+mmap = sc-jme_rxmbufm[i];
+bus_dmamap_sync(sc-jme_dmatag, mmap, 0,
+mmap-dm_mapsize, BUS_DMASYNC_POSTREAD);
+bus_dmamap_unload(sc-jme_dmatag, mmap);
 if ((error = 

CVS commit: [netbsd-5] src/sys/dev/usb

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:09:13 UTC 2011

Modified Files:
src/sys/dev/usb [netbsd-5]: if_rum.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1562):
sys/dev/usb/if_rum.c: revision 1.34
fix typo (clean up the rx list on failure setting it up, not the tx list)
from openbsd -r1.75, mentioned by Alexander Nasonov in PR 42667


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.4.1 src/sys/dev/usb/if_rum.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_rum.c
diff -u src/sys/dev/usb/if_rum.c:1.23 src/sys/dev/usb/if_rum.c:1.23.4.1
--- src/sys/dev/usb/if_rum.c:1.23	Tue Oct 21 12:21:46 2008
+++ src/sys/dev/usb/if_rum.c	Tue Mar  8 17:09:13 2011
@@ -1,5 +1,5 @@
 /*	$OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $	*/
-/*	$NetBSD: if_rum.c,v 1.23 2008/10/21 12:21:46 jun Exp $	*/
+/*	$NetBSD: if_rum.c,v 1.23.4.1 2011/03/08 17:09:13 riz Exp $	*/
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini damien.bergam...@free.fr
@@ -24,7 +24,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_rum.c,v 1.23 2008/10/21 12:21:46 jun Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_rum.c,v 1.23.4.1 2011/03/08 17:09:13 riz Exp $);
 
 #include bpfilter.h
 
@@ -629,7 +629,7 @@
 
 	return 0;
 
-fail:	rum_free_tx_list(sc);
+fail:	rum_free_rx_list(sc);
 	return error;
 }
 



CVS commit: [netbsd-5] src/sys/dev/raidframe

2011-03-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Mar  7 17:38:23 UTC 2011

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_paritymap.c

Log Message:
Pull up following revision(s) (requested by riz in ticket #1569):
sys/dev/raidframe/rf_paritymap.c: revision 1.6
Always return at least one parity region.  Fixes PR#44239.
Fix from oster@, code (such as it is) by me.


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.3 -r1.3.2.4 src/sys/dev/raidframe/rf_paritymap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_paritymap.c
diff -u src/sys/dev/raidframe/rf_paritymap.c:1.3.2.3 src/sys/dev/raidframe/rf_paritymap.c:1.3.2.4
--- src/sys/dev/raidframe/rf_paritymap.c:1.3.2.3	Sat Mar  6 21:05:29 2010
+++ src/sys/dev/raidframe/rf_paritymap.c	Mon Mar  7 17:38:22 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_paritymap.c,v 1.3.2.3 2010/03/06 21:05:29 sborrill Exp $ */
+/* $NetBSD: rf_paritymap.c,v 1.3.2.4 2011/03/07 17:38:22 snj Exp $ */
 
 /*-
  * Copyright (c) 2009 Jed Davis.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_paritymap.c,v 1.3.2.3 2010/03/06 21:05:29 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_paritymap.c,v 1.3.2.4 2011/03/07 17:38:22 snj Exp $);
 
 #include sys/param.h
 #include sys/callout.h
@@ -409,6 +409,8 @@
 	nreg = bytes_per_disk / REGION_MINSIZE;
 	if (nreg  RF_PARITYMAP_NREG)
 		nreg = RF_PARITYMAP_NREG;
+	if (nreg  1)
+		nreg = 1;
 
 	return (u_int)nreg;
 }



CVS commit: [netbsd-5] src/sys/dev/pci

2011-03-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Mar  7 04:14:20 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wm.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1544):
sys/dev/pci/if_wm.c: revision 1.219
wm_gmii_reset(): restore generic reset delays to what they were before
rev 1.186. This makes the following hardware find its PHY again, and I can't
see how these larger delays could be a problem for other hardware:
wm0 at pci6 dev 7 function 0: Intel i82541GI 1000BASE-T Ethernet, rev. 5
wm0: interrupting at ioapic2 pin 0, event channel 5
wm0: 32-bit 66MHz PCI bus
wm0: 65536 word (16 address bits) SPI EEPROM
wm0: Ethernet address 00:13:72:54:ee:13
igphy0 at wm0 phy 1: Intel IGP01E1000 Gigabit PHY, rev. 0
igphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FDX, auto


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.14 -r1.162.4.15 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.14 src/sys/dev/pci/if_wm.c:1.162.4.15
--- src/sys/dev/pci/if_wm.c:1.162.4.14	Fri Nov 19 23:40:28 2010
+++ src/sys/dev/pci/if_wm.c	Mon Mar  7 04:14:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.14 2010/11/19 23:40:28 riz Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.15 2011/03/07 04:14:19 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.14 2010/11/19 23:40:28 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.15 2011/03/07 04:14:19 riz Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -5147,9 +5147,9 @@
 	case WM_T_80003:
 		/* generic reset */
 		CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl | CTRL_PHY_RESET);
-		delay((sc-sc_type = WM_T_82571) ? 100 : 10*1000);
+		delay(2);
 		CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl);
-		delay(150);
+		delay(2);
 
 		if ((sc-sc_type == WM_T_82541)
 		|| (sc-sc_type == WM_T_82541_2)



CVS commit: [netbsd-5] src/sys/dev/pci

2011-02-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Feb 16 20:31:57 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: pci.c

Log Message:
Pull up following revision(s) (requested by dyoung in ticket #1540):
sys/dev/pci/pci.c: revision 1.131
During shutdown, restore the each PCI device's bus-mastering enable to
the state that we found it in before attaching a driver to it.


To generate a diff of this commit:
cvs rdiff -u -r1.119.4.1 -r1.119.4.2 src/sys/dev/pci/pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pci.c
diff -u src/sys/dev/pci/pci.c:1.119.4.1 src/sys/dev/pci/pci.c:1.119.4.2
--- src/sys/dev/pci/pci.c:1.119.4.1	Thu Nov 20 02:40:59 2008
+++ src/sys/dev/pci/pci.c	Wed Feb 16 20:31:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci.c,v 1.119.4.1 2008/11/20 02:40:59 snj Exp $	*/
+/*	$NetBSD: pci.c,v 1.119.4.2 2011/02/16 20:31:57 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci.c,v 1.119.4.1 2008/11/20 02:40:59 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci.c,v 1.119.4.2 2011/02/16 20:31:57 bouyer Exp $);
 
 #include opt_pci.h
 
@@ -869,6 +869,7 @@
 	int p_pm_offset;
 	pcireg_t p_pm_cap;
 	pcireg_t p_class;
+	pcireg_t p_csr;
 };
 
 static bool
@@ -922,9 +923,10 @@
 	struct pci_child_power *priv = device_pmf_bus_private(dv);
 	pcireg_t csr;
 
-	/* disable busmastering */
+	/* restore original bus-mastering state */
 	csr = pci_conf_read(priv-p_pc, priv-p_tag, PCI_COMMAND_STATUS_REG);
 	csr = ~PCI_COMMAND_MASTER_ENABLE;
+	csr |= priv-p_csr  PCI_COMMAND_MASTER_ENABLE;
 	pci_conf_write(priv-p_pc, priv-p_tag, PCI_COMMAND_STATUS_REG, csr);
 	return true;
 }
@@ -955,6 +957,8 @@
 	priv-p_tag = pci_make_tag(priv-p_pc, sc-sc_bus, device,
 	function);
 	priv-p_class = pci_conf_read(priv-p_pc, priv-p_tag, PCI_CLASS_REG);
+	priv-p_csr = pci_conf_read(priv-p_pc, priv-p_tag,
+	PCI_COMMAND_STATUS_REG);
 
 	if (pci_get_capability(priv-p_pc, priv-p_tag,
 			   PCI_CAP_PWRMGMT, off, reg)) {



CVS commit: [netbsd-5] src/sys/dev/usb

2011-01-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 16 12:40:22 UTC 2011

Modified Files:
src/sys/dev/usb [netbsd-5]: ukbd.c

Log Message:
Pull up following revision(s) (requested by mbalmer in ticket #1513):
sys/dev/usb/ukbd.c: revision 1.110
Cap h.loc.count at MAXKEYCODE instead of bailing out.  This lets some obscure/
roque keyboards attach.
From logana...@devio.us (Loganaden Velvindron), thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.101.4.1 -r1.101.4.2 src/sys/dev/usb/ukbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ukbd.c
diff -u src/sys/dev/usb/ukbd.c:1.101.4.1 src/sys/dev/usb/ukbd.c:1.101.4.2
--- src/sys/dev/usb/ukbd.c:1.101.4.1	Sun Feb 14 13:58:32 2010
+++ src/sys/dev/usb/ukbd.c	Sun Jan 16 12:40:22 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: ukbd.c,v 1.101.4.1 2010/02/14 13:58:32 bouyer Exp $*/
+/*  $NetBSD: ukbd.c,v 1.101.4.2 2011/01/16 12:40:22 bouyer Exp $*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ukbd.c,v 1.101.4.1 2010/02/14 13:58:32 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: ukbd.c,v 1.101.4.2 2011/01/16 12:40:22 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -869,7 +869,7 @@
 			if (h.loc.size != 8)
 return (key code size != 8);
 			if (h.loc.count  MAXKEYCODE)
-return (too many key codes);
+h.loc.count = MAXKEYCODE;
 			if (h.loc.pos % 8 != 0)
 return (key codes not on byte boundary);
 			if (sc-sc_nkeycode != 0)



CVS commit: [netbsd-5] src/sys/dev/pci

2011-01-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 16 12:51:59 UTC 2011

Modified Files:
src/sys/dev/pci [netbsd-5]: if_jme.c

Log Message:
Pull up following revision(s) (requested by kochi in ticket #1525):
sys/dev/pci/if_jme.c: revision 1.16
Try reading MAC addr from register if it fails to read from EEPROM.
Copied from FreeBSD driver.
Without this my JMC261 doesn't get MAC address properly.
OK'ed by bouyer@


To generate a diff of this commit:
cvs rdiff -u -r1.4.6.2 -r1.4.6.3 src/sys/dev/pci/if_jme.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_jme.c
diff -u src/sys/dev/pci/if_jme.c:1.4.6.2 src/sys/dev/pci/if_jme.c:1.4.6.3
--- src/sys/dev/pci/if_jme.c:1.4.6.2	Mon Feb  2 20:50:11 2009
+++ src/sys/dev/pci/if_jme.c	Sun Jan 16 12:51:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_jme.c,v 1.4.6.2 2009/02/02 20:50:11 snj Exp $	*/
+/*	$NetBSD: if_jme.c,v 1.4.6.3 2011/01/16 12:51:59 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2008 Manuel Bouyer.  All rights reserved.
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_jme.c,v 1.4.6.2 2009/02/02 20:50:11 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_jme.c,v 1.4.6.3 2011/01/16 12:51:59 bouyer Exp $);
 
 
 #include sys/param.h
@@ -223,6 +223,7 @@
 
 static int jme_eeprom_read_byte(struct jme_softc *, uint8_t, uint8_t *);
 static int jme_eeprom_macaddr(struct jme_softc *);
+static int jme_reg_macaddr(struct jme_softc *);
 
 #define JME_TIMEOUT		1000
 #define JME_PHY_TIMEOUT		1000
@@ -392,7 +393,7 @@
 	jme_reset(sc);
 
 	/* read mac addr */
-	if (jme_eeprom_macaddr(sc)) {
+	if (jme_eeprom_macaddr(sc)  jme_reg_macaddr(sc)) {
 		aprint_error_dev(self, error reading Ethernet address\n);
 		/* return; */
 	}
@@ -2005,6 +2006,28 @@
 	return (ENOENT);
 }
 
+static int
+jme_reg_macaddr(struct jme_softc *sc)
+{
+	uint32_t par0, par1;
+
+	par0 = bus_space_read_4(sc-jme_bt_mac, sc-jme_bh_mac, JME_PAR0);
+	par1 = bus_space_read_4(sc-jme_bt_mac, sc-jme_bh_mac, JME_PAR1);
+	par1 = 0x;
+	if ((par0 == 0  par1 == 0) ||
+	(par0 == 0x  par1 == 0x)) {
+		return (ENOENT);
+	} else {
+		sc-jme_enaddr[0] = (par0  0)  0xff;
+		sc-jme_enaddr[1] = (par0  8)  0xff;
+		sc-jme_enaddr[2] = (par0  16)  0xff;
+		sc-jme_enaddr[3] = (par0  24)  0xff;
+		sc-jme_enaddr[4] = (par1  0)  0xff;
+		sc-jme_enaddr[5] = (par1  8)  0xff;
+	}
+	return (0);
+}
+
 /*
  * Set up sysctl(3) MIB, hw.jme.* - Individual controllers will be
  * set up in jme_pci_attach()



CVS commit: [netbsd-5] src/sys/dev/ic

2011-01-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 16 13:06:49 UTC 2011

Modified Files:
src/sys/dev/ic [netbsd-5]: ahcisata_core.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1530):
sys/dev/ic/ahcisata_core.c: revision 1.31
Don't call bus_dmamap_load(9) and bus_dmamap_sync(9) on command xfers
if (AT_READ|AT_WRITE) in ata_c-flags is set but ata_c-bcount is zero.
Someone actually tries to put such a command and it causes
DIAGNOSTIC panic in x86/bus_dma.c:_bus_dmamap_sync().
I think bus_dma(9) API itself may allow calls with mapsize==0
but there are many MD code that asserts offset=mapsize or len==0.
The problem is reported and fix is confirmed by Takuro KUBOTA
with XEN DOM0 kernel (which has options DIAGNOSTIC).


To generate a diff of this commit:
cvs rdiff -u -r1.18.4.4 -r1.18.4.5 src/sys/dev/ic/ahcisata_core.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.18.4.4 src/sys/dev/ic/ahcisata_core.c:1.18.4.5
--- src/sys/dev/ic/ahcisata_core.c:1.18.4.4	Sun Mar 28 16:21:18 2010
+++ src/sys/dev/ic/ahcisata_core.c	Sun Jan 16 13:06:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.18.4.4 2010/03/28 16:21:18 snj Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.18.4.5 2011/01/16 13:06:49 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ahcisata_core.c,v 1.18.4.4 2010/03/28 16:21:18 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahcisata_core.c,v 1.18.4.5 2011/01/16 13:06:49 bouyer Exp $);
 
 #include sys/types.h
 #include sys/malloc.h
@@ -729,7 +729,8 @@
 	AHCIDEBUG_PRINT((%s port %d header %p\n, AHCINAME(sc),
 	chp-ch_channel, cmd_h), DEBUG_XFERS);
 	if (ahci_dma_setup(chp, slot,
-	(ata_c-flags  (AT_READ|AT_WRITE)) ? ata_c-data : NULL,
+	(ata_c-flags  (AT_READ|AT_WRITE)  ata_c-bcount  0) ?
+	ata_c-data : NULL,
 	ata_c-bcount,
 	(ata_c-flags  AT_READ) ? BUS_DMA_READ : BUS_DMA_WRITE)) {
 		ata_c-flags |= AT_DF;
@@ -862,7 +863,7 @@
 	/* this comamnd is not active any more */
 	achp-ahcic_cmds_active = ~(1  slot);
 
-	if (ata_c-flags  (AT_READ|AT_WRITE)) {
+	if (ata_c-flags  (AT_READ|AT_WRITE)  ata_c-bcount  0) {
 		bus_dmamap_sync(sc-sc_dmat, achp-ahcic_datad[slot], 0,
 		achp-ahcic_datad[slot]-dm_mapsize,
 		(ata_c-flags  AT_READ) ? BUS_DMASYNC_POSTREAD :



CVS commit: [netbsd-5] src/sys/dev/raidframe

2011-01-07 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 23:25:59 UTC 2011

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_disks.c rf_netbsdkintf.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1522):
sys/dev/raidframe/rf_disks.c: revision 1.76
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.276
apply my patch to support non-512K sector disks (at least, upto 16KB
sector disks..)  from my tech-kern post:
the following patch let's me access both 512 byte and 4K
sector disks at the same time, as long as they are in
separate raids.  the existing rf code assumes/enforces
this part, i just made it support other sets concurrently.
the main change is moving the parity bitmap to the sector
after the component label sector(s), instead of being
immediately after the label, which meant it was on the same
sector as the label for 1024 byte devices.
i'm a little annoyed at having to add a 2nd call to
getdisksize() to enable auto-configure to work, but i
don't see another way that wasn't much uglier.


To generate a diff of this commit:
cvs rdiff -u -r1.70.10.3 -r1.70.10.4 src/sys/dev/raidframe/rf_disks.c
cvs rdiff -u -r1.250.4.8 -r1.250.4.9 src/sys/dev/raidframe/rf_netbsdkintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_disks.c
diff -u src/sys/dev/raidframe/rf_disks.c:1.70.10.3 src/sys/dev/raidframe/rf_disks.c:1.70.10.4
--- src/sys/dev/raidframe/rf_disks.c:1.70.10.3	Sun Nov 21 22:06:53 2010
+++ src/sys/dev/raidframe/rf_disks.c	Fri Jan  7 23:25:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_disks.c,v 1.70.10.3 2010/11/21 22:06:53 riz Exp $	*/
+/*	$NetBSD: rf_disks.c,v 1.70.10.4 2011/01/07 23:25:59 riz Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -60,7 +60,7 @@
  ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_disks.c,v 1.70.10.3 2010/11/21 22:06:53 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_disks.c,v 1.70.10.4 2011/01/07 23:25:59 riz Exp $);
 
 #include dev/raidframe/raidframevar.h
 
@@ -597,16 +597,26 @@
 		if (error == ENXIO) {
 			/* the component isn't there... must be dead :-( */
 			diskPtr-status = rf_ds_failed;
+			return 0;
 		} else {
 			return (error);
 		}
 	}
-	if (diskPtr-status == rf_ds_optimal) {
 
+	if ((error = rf_getdisksize(vp, curlwp, diskPtr)) != 0)
+		return (error);
+
+	/*
+	 * If this raidPtr's bytesPerSector is zero, fill it in with this
+	 * components blockSize.  This will give us something to work with
+	 * initially, and if it is wrong, we'll get errors later.
+	 */
+	if (raidPtr-bytesPerSector == 0)
+		raidPtr-bytesPerSector = diskPtr-blockSize;
+
+	if (diskPtr-status == rf_ds_optimal) {
 		if ((error = VOP_GETATTR(vp, va, curlwp-l_cred)) != 0) 
 			return (error);
-		if ((error = rf_getdisksize(vp, curlwp, diskPtr)) != 0)
-			return (error);
 
 		raidPtr-raid_cinfo[col].ci_vp = vp;
 		raidPtr-raid_cinfo[col].ci_dev = va.va_rdev;

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.8 src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.9
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.8	Sun Nov 21 22:06:53 2010
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Fri Jan  7 23:25:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.8 2010/11/21 22:06:53 riz Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.9 2011/01/07 23:25:59 riz Exp $	*/
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -139,7 +139,7 @@
  ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.8 2010/11/21 22:06:53 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.9 2011/01/07 23:25:59 riz Exp $);
 
 #include sys/param.h
 #include sys/errno.h
@@ -219,10 +219,10 @@
 static int raidwrite_component_area(dev_t, struct vnode *, void *, size_t,
 daddr_t, daddr_t, int);
 
-static int raidwrite_component_label(dev_t, struct vnode *,
-RF_ComponentLabel_t *);
-static int raidread_component_label(dev_t, struct vnode *,
-RF_ComponentLabel_t *);
+static int raidwrite_component_label(unsigned,
+dev_t, struct vnode *, RF_ComponentLabel_t *);
+static int raidread_component_label(unsigned,
+dev_t, struct vnode *, RF_ComponentLabel_t *);
 
 
 dev_type_open(raidopen);
@@ -1001,8 +1001,8 @@
 	rs = raid_softc[unit];
 	raidPtr = raidPtrs[unit];
 
-	db1_printf((raidioctl: %d %d %d %d\n, (int) dev,
-		(int) DISKPART(dev), (int) unit, (int) cmd));
+	db1_printf((raidioctl: %d %d %d %lu\n, (int) dev,
+		(int) DISKPART(dev), (int) unit, cmd));
 
 	/* Must be open for writes for these commands... */
 	switch (cmd) {
@@ -2400,10 +2400,57 @@
 
 #define RF_COMPONENT_INFO_OFFSET  16384 /* bytes */
 #define RF_COMPONENT_INFO_SIZE 1024 /* 

CVS commit: [netbsd-5] src/sys/dev/raidframe

2011-01-07 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 23:27:52 UTC 2011

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_netbsdkintf.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1511):
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.278
add a hack to fix up old labels that do not have zero's in numBlocksHi:
if the total sectors reported (via disklabel or otherwise) is smaller
than 2^32, but numBlocksHi is set, zero it out instead.
tested by myself and christos, should fix reports of weirdness seen.


To generate a diff of this commit:
cvs rdiff -u -r1.250.4.9 -r1.250.4.10 src/sys/dev/raidframe/rf_netbsdkintf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.9 src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.10
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.250.4.9	Fri Jan  7 23:25:59 2011
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Fri Jan  7 23:27:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.9 2011/01/07 23:25:59 riz Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.250.4.10 2011/01/07 23:27:51 riz Exp $	*/
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -139,7 +139,7 @@
  ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.9 2011/01/07 23:25:59 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.250.4.10 2011/01/07 23:27:51 riz Exp $);
 
 #include sys/param.h
 #include sys/errno.h
@@ -329,6 +329,7 @@
 void rf_cleanup_config_set(RF_ConfigSet_t *);
 int rf_have_enough_components(RF_ConfigSet_t *);
 int rf_auto_config_set(RF_ConfigSet_t *, int *);
+static void rf_fix_old_label_size(RF_ComponentLabel_t *, uint64_t);
 
 static int raidautoconfig = 0; /* Debugging, mostly.  Set to 0 to not
   allow autoconfig to take place.
@@ -2947,6 +2948,7 @@
 		/* Got the label.  Does it look reasonable? */
 		if (rf_reasonable_label(clabel)  
 		(clabel-partitionSize = size)) {
+			rf_fix_old_label_size(clabel, numsecs);
 #ifdef DEBUG
 			printf(Component on: %s: %llu\n,
 cname, (unsigned long long)size);
@@ -3153,6 +3155,24 @@
 }
 
 
+/*
+ * For reasons yet unknown, some old component labels have garbage in
+ * the newer numBlocksHi region, and this causes lossage.  Since those
+ * disks will also have numsecs set to less than 32 bits of sectors,
+ * we can determine when this corruption has occured, and fix it.
+ */
+static void
+rf_fix_old_label_size(RF_ComponentLabel_t *clabel, uint64_t numsecs)
+{
+
+	if (clabel-numBlocksHi  numsecs  ((uint64_t)1  32)) {
+		printf(WARNING: total sectors  32 bits, yet numBlocksHi set\n
+		   WARNING: resetting numBlocksHi to zero.\n);
+		clabel-numBlocksHi = 0;
+	}
+}
+
+
 #ifdef DEBUG
 void
 rf_print_component_label(RF_ComponentLabel_t *clabel)



CVS commit: [netbsd-5] src/sys/dev

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:35:05 UTC 2011

Modified Files:
src/sys/dev [netbsd-5]: rnd.c

Log Message:
Pull up following revision(s) (requested by pooka in ticket #1502):
sys/dev/rnd.c: revision 1.79
Don't allow goes to 11^H^Hhyperspace len field for RNDADDATA.


To generate a diff of this commit:
cvs rdiff -u -r1.71.4.2 -r1.71.4.3 src/sys/dev/rnd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/rnd.c
diff -u src/sys/dev/rnd.c:1.71.4.2 src/sys/dev/rnd.c:1.71.4.3
--- src/sys/dev/rnd.c:1.71.4.2	Sun Nov 15 05:46:23 2009
+++ src/sys/dev/rnd.c	Fri Jan  7 01:35:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rnd.c,v 1.71.4.2 2009/11/15 05:46:23 snj Exp $	*/
+/*	$NetBSD: rnd.c,v 1.71.4.3 2011/01/07 01:35:05 riz Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rnd.c,v 1.71.4.2 2009/11/15 05:46:23 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rnd.c,v 1.71.4.3 2011/01/07 01:35:05 riz Exp $);
 
 #include sys/param.h
 #include sys/ioctl.h
@@ -636,6 +636,9 @@
 	case RNDADDDATA:
 		rnddata = (rnddata_t *)addr;
 
+		if (rnddata-len  sizeof(rnddata-data))
+			return E2BIG;
+
 		mutex_enter(rndpool_mtx);
 		rndpool_add_data(rnd_pool, rnddata-data, rnddata-len,
 		rnddata-entropy);



CVS commit: [netbsd-5] src/sys/dev/sysmon

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:55:31 UTC 2011

Modified Files:
src/sys/dev/sysmon [netbsd-5]: sysmon_envsys_events.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1505):
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.94
Make this compile when options ENVSYS_OBJECTS_DEBUG is defined.


To generate a diff of this commit:
cvs rdiff -u -r1.58.4.4 -r1.58.4.5 src/sys/dev/sysmon/sysmon_envsys_events.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.58.4.4 src/sys/dev/sysmon/sysmon_envsys_events.c:1.58.4.5
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.58.4.4	Thu Nov 13 00:10:25 2008
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Fri Jan  7 01:55:31 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.58.4.4 2008/11/13 00:10:25 snj Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.58.4.5 2011/01/07 01:55:31 riz Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.58.4.4 2008/11/13 00:10:25 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.58.4.5 2011/01/07 01:55:31 riz Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -627,6 +627,11 @@
 			sysmon_penvsys_event(see-see_pes, sse[i].event);
 
 		see-see_evsent = edata-state;
+		DPRINTFOBJ((%s: (%s) desc=%s sensor=%d state=%d send_ev=%d\n,
+		__func__, see-see_sme-sme_name, edata-desc,
+		edata-sensor, edata-state,
+		(edata-state == ENVSYS_SVALID) ? PENVSYS_EVENT_NORMAL :
+			sse[i].event));
 
 		break;
 



CVS commit: [netbsd-5] src/sys/dev/sbus

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 03:52:34 UTC 2011

Modified Files:
src/sys/dev/sbus [netbsd-5]: spif.c

Log Message:
Pull up following revision(s) (requested by hauke in ticket #1506):
sys/dev/sbus/spif.c: revision 1.19
Fix warning about missing initializer that showed up in sparc64
builds, but, strangely enough, not in sparc builds.
Relevant for netbsd-{4,5} release branches.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.6.1 src/sys/dev/sbus/spif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sbus/spif.c
diff -u src/sys/dev/sbus/spif.c:1.18 src/sys/dev/sbus/spif.c:1.18.6.1
--- src/sys/dev/sbus/spif.c:1.18	Wed Jun 11 21:25:31 2008
+++ src/sys/dev/sbus/spif.c	Fri Jan  7 03:52:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: spif.c,v 1.18 2008/06/11 21:25:31 drochner Exp $	*/
+/*	$NetBSD: spif.c,v 1.18.6.1 2011/01/07 03:52:34 riz Exp $	*/
 /*	$OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: spif.c,v 1.18 2008/06/11 21:25:31 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: spif.c,v 1.18.6.1 2011/01/07 03:52:34 riz Exp $);
 
 #include spif.h
 #if NSPIF  0
@@ -110,7 +110,7 @@
 
 const struct cdevsw sbpp_cdevsw = {
 	sbpp_open, sbpp_close, sbpp_read, sbpp_write, sbpp_ioctl,
-	nostop, notty, sbpp_poll, nommap, nokqfilter,
+	nostop, notty, sbpp_poll, nommap, nokqfilter, D_OTHER
 };
 
 



CVS commit: [netbsd-5] src/sys/dev

2010-12-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Dec 21 22:25:57 UTC 2010

Modified Files:
src/sys/dev [netbsd-5]: audio.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1498):
sys/dev/audio.c: revision 1.252
Fix botches in rev 1.185 (kent-audio1 merge) which cause buffer overrun
and tlb_exception: no copyin/out fault hander panic in
audio_fill_silence() after audio playback on dreamcast.
The problem is tracked and fix is provieded by Ryo SHIMIZU,
who is the auther of aica(4) audio driver for dreamcast.


To generate a diff of this commit:
cvs rdiff -u -r1.243.6.3 -r1.243.6.4 src/sys/dev/audio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.243.6.3 src/sys/dev/audio.c:1.243.6.4
--- src/sys/dev/audio.c:1.243.6.3	Fri Oct 16 05:43:37 2009
+++ src/sys/dev/audio.c	Tue Dec 21 22:25:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.243.6.3 2009/10/16 05:43:37 snj Exp $	*/
+/*	$NetBSD: audio.c,v 1.243.6.4 2010/12/21 22:25:56 riz Exp $	*/
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: audio.c,v 1.243.6.3 2009/10/16 05:43:37 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: audio.c,v 1.243.6.4 2010/12/21 22:25:56 riz Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -2780,8 +2780,8 @@
 
 			/* Clear next block so we keep ahead of the DMA. */
 			used = audio_stream_get_used(cb-s);
-			if (used + cc  cb-s.end - cb-s.start)
-audio_pint_silence(sc, cb, inp, blksize);
+			if (used + blksize  cb-s.end - cb-s.start)
+audio_pint_silence(sc, cb, cb-s.inp, blksize);
 		}
 	}
 



CVS commit: [netbsd-5] src/sys/dev/ic

2010-12-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Dec  2 23:42:37 UTC 2010

Modified Files:
src/sys/dev/ic [netbsd-5]: iavc.c

Log Message:
Pull up following revision(s) (requested by riz in ticket #1418):
sys/dev/ic/iavc.c: revision 1.8
Make this compile foo[0] does not work for void * :-) Wojciech Galazka


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.14.1 src/sys/dev/ic/iavc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/iavc.c
diff -u src/sys/dev/ic/iavc.c:1.7 src/sys/dev/ic/iavc.c:1.7.14.1
--- src/sys/dev/ic/iavc.c:1.7	Tue Apr  8 12:07:26 2008
+++ src/sys/dev/ic/iavc.c	Thu Dec  2 23:42:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: iavc.c,v 1.7 2008/04/08 12:07:26 cegger Exp $	*/
+/*	$NetBSD: iavc.c,v 1.7.14.1 2010/12/02 23:42:37 snj Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Cubical Solutions Ltd. All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iavc.c,v 1.7 2008/04/08 12:07:26 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: iavc.c,v 1.7.14.1 2010/12/02 23:42:37 snj Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -892,7 +892,7 @@
 u_int8_t *dmabuf = 0, cmd;
 
 if (sc-sc_dma) {
-	dmabuf = amcc_get_byte(sc-sc_recvbuf[0], cmd);
+	dmabuf = amcc_get_byte(sc-sc_recvbuf, cmd);
 } else {
 	cmd = iavc_get_byte(sc);
 }
@@ -1004,9 +1004,9 @@
 	/* Copy message to DMA buffer. */
 
 	if (m-m_next)
-	dmabuf = amcc_put_byte(sc-sc_sendbuf[0], SEND_DATA_B3_REQ);
+	dmabuf = amcc_put_byte(sc-sc_sendbuf, SEND_DATA_B3_REQ);
 	else
-	dmabuf = amcc_put_byte(sc-sc_sendbuf[0], SEND_MESSAGE);
+	dmabuf = amcc_put_byte(sc-sc_sendbuf, SEND_MESSAGE);
 
 	dmabuf = amcc_put_word(dmabuf, m-m_len);
 	memcpy(dmabuf, m-m_data, m-m_len);
@@ -1061,7 +1061,7 @@
 uint8_t *dmabuf;
 
 if (sc-sc_dma) {
-	memcpy(sc-sc_sendbuf[0], m-m_data + 2, m-m_len - 2);
+	memcpy(sc-sc_sendbuf, m-m_data + 2, m-m_len - 2);
 	txlen = m-m_len - 2;
 } else {
 



CVS commit: [netbsd-5] src/sys/dev/ic

2010-12-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Dec  2 23:45:59 UTC 2010

Modified Files:
src/sys/dev/ic [netbsd-5]: mpt.c mpt.h mpt_debug.c mpt_netbsd.c

Log Message:
Pull up following revision(s) (requested by riz in ticket #1487):
sys/dev/ic/mpt.c: revision 1.14
sys/dev/ic/mpt.h: revision 1.7
sys/dev/ic/mpt_debug.c: revision 1.7
sys/dev/ic/mpt_netbsd.c: revision 1.15
add byte-swapping so that this works on BE platforms.
the logic is based on the current freebsd driver.
fixes PR 42870.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.42.1 src/sys/dev/ic/mpt.c
cvs rdiff -u -r1.6 -r1.6.42.1 src/sys/dev/ic/mpt.h
cvs rdiff -u -r1.4 -r1.4.86.1 src/sys/dev/ic/mpt_debug.c
cvs rdiff -u -r1.14 -r1.14.14.1 src/sys/dev/ic/mpt_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/mpt.c
diff -u src/sys/dev/ic/mpt.c:1.10 src/sys/dev/ic/mpt.c:1.10.42.1
--- src/sys/dev/ic/mpt.c:1.10	Fri Jul 27 18:38:13 2007
+++ src/sys/dev/ic/mpt.c	Thu Dec  2 23:45:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpt.c,v 1.10 2007/07/27 18:38:13 tron Exp $	*/
+/*	$NetBSD: mpt.c,v 1.10.42.1 2010/12/02 23:45:59 snj Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 by Greg Ansley
@@ -27,6 +27,75 @@
 /*
  * Additional Copyright (c) 2002 by Matthew Jacob under same license.
  */
+/*-
+ * Copyright (c) 2002, 2006 by Matthew Jacob
+ * 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 at minimum a disclaimer
+ *substantially similar to the NO WARRANTY disclaimer below
+ *(Disclaimer) and any redistribution must be conditioned upon including
+ *a substantially similar Disclaimer requirement for further binary
+ *redistribution.
+ * 3. Neither the names of the above listed copyright holders nor the names
+ *of any 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 THE COPYRIGHT
+ * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Support from Chris Ellsworth in order to make SAS adapters work
+ * is gratefully acknowledged.
+ *
+ *
+ * Support from LSI-Logic has also gone a great deal toward making this a
+ * workable subsystem and is gratefully acknowledged.
+ */
+/*-
+ * Copyright (c) 2004, Avid Technology, Inc. and its contributors.
+ * Copyright (c) 2005, WHEEL Sp. z o.o.
+ * Copyright (c) 2004, 2005 Justin T. Gibbs
+ * 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 at minimum a disclaimer
+ *substantially similar to the NO WARRANTY disclaimer below
+ *(Disclaimer) and any redistribution must be conditioned upon including
+ *a substantially similar Disclaimer requirement for further binary
+ *redistribution.
+ * 3. Neither the names of the above listed copyright holders nor the names
+ *of any 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) 

CVS commit: [netbsd-5] src/sys/dev/usb

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:29:13 UTC 2010

Modified Files:
src/sys/dev/usb [netbsd-5]: umass_quirks.c usbdevs

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1489):
sys/dev/usb/umass_quirks.c: revision 1.82
sys/dev/usb/usbdevs: revision 1.564
Add Kingston DT Mini 10 pendrive
Regen
Add quirk for Kingston DT Mini 10 to stop it giving HBA errors.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.76.2.1 src/sys/dev/usb/umass_quirks.c
cvs rdiff -u -r1.519.4.7 -r1.519.4.8 src/sys/dev/usb/usbdevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/umass_quirks.c
diff -u src/sys/dev/usb/umass_quirks.c:1.76 src/sys/dev/usb/umass_quirks.c:1.76.2.1
--- src/sys/dev/usb/umass_quirks.c:1.76	Mon Oct 27 21:46:43 2008
+++ src/sys/dev/usb/umass_quirks.c	Fri Nov 26 17:29:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass_quirks.c,v 1.76 2008/10/27 21:46:43 joerg Exp $	*/
+/*	$NetBSD: umass_quirks.c,v 1.76.2.1 2010/11/26 17:29:13 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: umass_quirks.c,v 1.76 2008/10/27 21:46:43 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: umass_quirks.c,v 1.76.2.1 2010/11/26 17:29:13 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -221,6 +221,14 @@
 	  UMATCH_VENDOR_PRODUCT,
 	  NULL, NULL
 	},
+	/* Kingston generic HBA errors */
+	{ { USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DTMINI10 },
+	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
+	  0,
+	  PQUIRK_NODOORLOCK,
+	  UMATCH_VENDOR_PRODUCT,
+	  NULL, NULL
+	},
 };
 
 const struct umass_quirk *

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.519.4.7 src/sys/dev/usb/usbdevs:1.519.4.8
--- src/sys/dev/usb/usbdevs:1.519.4.7	Sun Nov 21 03:05:04 2010
+++ src/sys/dev/usb/usbdevs	Fri Nov 26 17:29:13 2010
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.519.4.7 2010/11/21 03:05:04 riz Exp $
+$NetBSD: usbdevs,v 1.519.4.8 2010/11/26 17:29:13 riz Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1372,6 +1372,7 @@
 /* Kingston products */
 product KINGSTON XX1		0x0008	Ethernet Adapter
 product KINGSTON KNU101TX	0x000a	KNU101TX USB Ethernet
+product KINGSTON DTMINI10	0x162c	DT Mini 10 
 
 /* Kodak products */
 product KODAK DC220		0x0100	Digital Science DC220



CVS commit: [netbsd-5] src/sys/dev/usb

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:29:51 UTC 2010

Modified Files:
src/sys/dev/usb [netbsd-5]: usbdevs.h usbdevs_data.h

Log Message:
Regen for ticket 1489.


To generate a diff of this commit:
cvs rdiff -u -r1.515.4.7 -r1.515.4.8 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.516.4.7 -r1.516.4.8 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.515.4.7 src/sys/dev/usb/usbdevs.h:1.515.4.8
--- src/sys/dev/usb/usbdevs.h:1.515.4.7	Sun Nov 21 10:11:58 2010
+++ src/sys/dev/usb/usbdevs.h	Fri Nov 26 17:29:50 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.515.4.7 2010/11/21 10:11:58 martin Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.515.4.8 2010/11/26 17:29:50 riz Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.519.4.7 2010/11/21 03:05:04 riz Exp
+ *	NetBSD
  */
 
 /*
@@ -1379,6 +1379,7 @@
 /* Kingston products */
 #define	USB_PRODUCT_KINGSTON_XX1	0x0008		/* Ethernet Adapter */
 #define	USB_PRODUCT_KINGSTON_KNU101TX	0x000a		/* KNU101TX USB Ethernet */
+#define	USB_PRODUCT_KINGSTON_DTMINI10	0x162c		/* DT Mini 10 */
 
 /* Kodak products */
 #define	USB_PRODUCT_KODAK_DC220	0x0100		/* Digital Science DC220 */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.516.4.7 src/sys/dev/usb/usbdevs_data.h:1.516.4.8
--- src/sys/dev/usb/usbdevs_data.h:1.516.4.7	Sun Nov 21 10:11:58 2010
+++ src/sys/dev/usb/usbdevs_data.h	Fri Nov 26 17:29:50 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.516.4.7 2010/11/21 10:11:58 martin Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.516.4.8 2010/11/26 17:29:50 riz Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.519.4.7 2010/11/21 03:05:04 riz Exp
+ *	NetBSD
  */
 
 /*
@@ -4083,6 +4083,10 @@
 	KNU101TX USB Ethernet,
 	},
 	{
+	USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DTMINI10,
+	DT Mini 10,
+	},
+	{
 	USB_VENDOR_KODAK, USB_PRODUCT_KODAK_DC220,
 	Digital Science DC220,
 	},
@@ -6855,4 +6859,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1247;
+const int usb_nproducts = 1248;



CVS commit: [netbsd-5] src/sys/dev/usb

2010-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 21 10:11:59 UTC 2010

Modified Files:
src/sys/dev/usb [netbsd-5]: usbdevs.h usbdevs_data.h

Log Message:
Regen (accidently mssing form [pullup-5 #1407])


To generate a diff of this commit:
cvs rdiff -u -r1.515.4.6 -r1.515.4.7 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.516.4.6 -r1.516.4.7 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.515.4.6 src/sys/dev/usb/usbdevs.h:1.515.4.7
--- src/sys/dev/usb/usbdevs.h:1.515.4.6	Sat Nov 20 01:15:06 2010
+++ src/sys/dev/usb/usbdevs.h	Sun Nov 21 10:11:58 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.515.4.6 2010/11/20 01:15:06 riz Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.515.4.7 2010/11/21 10:11:58 martin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD
+ *	NetBSD: usbdevs,v 1.519.4.7 2010/11/21 03:05:04 riz Exp
  */
 
 /*
@@ -688,6 +688,7 @@
 #define	USB_PRODUCT_APPLE_EXT_KBD	0x020c		/* Apple Extended USB Keyboard */
 #define	USB_PRODUCT_APPLE_OPTMOUSE	0x0302		/* Optical mouse */
 #define	USB_PRODUCT_APPLE_MIGHTYMOUSE	0x0304		/* Mighty Mouse */
+#define	USB_PRODUCT_APPLE_MAGICMOUSE	0x030d		/* Magic Mouse */
 #define	USB_PRODUCT_APPLE_EXT_KBD_HUB	0x1003		/* Hub in Apple Extended USB Keyboard */
 #define	USB_PRODUCT_APPLE_SPEAKERS	0x1101		/* Speakers */
 #define	USB_PRODUCT_APPLE_IPHONE	0x1290		/* iPhone */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.516.4.6 src/sys/dev/usb/usbdevs_data.h:1.516.4.7
--- src/sys/dev/usb/usbdevs_data.h:1.516.4.6	Sat Nov 20 01:15:07 2010
+++ src/sys/dev/usb/usbdevs_data.h	Sun Nov 21 10:11:58 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.516.4.6 2010/11/20 01:15:07 riz Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.516.4.7 2010/11/21 10:11:58 martin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD
+ *	NetBSD: usbdevs,v 1.519.4.7 2010/11/21 03:05:04 riz Exp
  */
 
 /*
@@ -2271,6 +2271,10 @@
 	Mighty Mouse,
 	},
 	{
+	USB_VENDOR_APPLE, USB_PRODUCT_APPLE_MAGICMOUSE,
+	Magic Mouse,
+	},
+	{
 	USB_VENDOR_APPLE, USB_PRODUCT_APPLE_EXT_KBD_HUB,
 	Hub in Apple Extended USB Keyboard,
 	},
@@ -6851,4 +6855,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1246;
+const int usb_nproducts = 1247;



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 19:29:31 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: ahcisata_pci.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1437):
sys/dev/pci/ahcisata_pci.c: revision 1.22
Add NVIDIA MCP77 to the quirk table, so ahcisata will attach when the
BIOS is set to 'RAID' mode.


To generate a diff of this commit:
cvs rdiff -u -r1.12.4.2 -r1.12.4.3 src/sys/dev/pci/ahcisata_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.12.4.2 src/sys/dev/pci/ahcisata_pci.c:1.12.4.3
--- src/sys/dev/pci/ahcisata_pci.c:1.12.4.2	Mon Mar 30 16:49:25 2009
+++ src/sys/dev/pci/ahcisata_pci.c	Sun Nov 21 19:29:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.12.4.2 2009/03/30 16:49:25 snj Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.12.4.3 2010/11/21 19:29:30 riz Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ahcisata_pci.c,v 1.12.4.2 2009/03/30 16:49:25 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahcisata_pci.c,v 1.12.4.3 2010/11/21 19:29:30 riz Exp $);
 
 #include sys/types.h
 #include sys/malloc.h
@@ -64,6 +64,30 @@
 	AHCI_PCI_QUIRK_FORCE },
 	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_AHCI_1,
 	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_1,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_2,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_3,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_4,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_5,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_6,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_7,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_8,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_9,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_10,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_11,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP77_AHCI_12,
+	AHCI_PCI_QUIRK_FORCE },
 };
 
 struct ahci_pci_softc {



CVS commit: [netbsd-5] src/sys/dev/pci/hdaudio

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 20:18:41 UTC 2010

Modified Files:
src/sys/dev/pci/hdaudio [netbsd-5]: hdaudio.c hdaudio_afg.c
hdaudio_pci.c
Added Files:
src/sys/dev/pci/hdaudio [netbsd-5]: hdaudio_pci.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1441):
sys/dev/pci/hdaudio/hdaudio_afg.c: revision 1.23
sys/dev/pci/hdaudio/hdaudio.c: revision 1.7
sys/dev/pci/hdaudio/hdaudio_pci.h: revision 1.1
sys/dev/pci/hdaudio/hdaudio_pci.c: revision 1.6
Reject invalid vendor IDs (say if there was a RIRB timeout while reading the
VID registers)
add support for nvidia hdaudio controllers
properly round block and buffer sizes -- nvidia HDA controllers work now


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.3 -r1.4.4.4 src/sys/dev/pci/hdaudio/hdaudio.c
cvs rdiff -u -r1.14.2.6 -r1.14.2.7 src/sys/dev/pci/hdaudio/hdaudio_afg.c
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/dev/pci/hdaudio/hdaudio_pci.c
cvs rdiff -u -r0 -r1.1.6.2 src/sys/dev/pci/hdaudio/hdaudio_pci.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/hdaudio/hdaudio.c
diff -u src/sys/dev/pci/hdaudio/hdaudio.c:1.4.4.3 src/sys/dev/pci/hdaudio/hdaudio.c:1.4.4.4
--- src/sys/dev/pci/hdaudio/hdaudio.c:1.4.4.3	Sun Oct 18 16:50:13 2009
+++ src/sys/dev/pci/hdaudio/hdaudio.c	Sun Nov 21 20:18:41 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.4.4.3 2009/10/18 16:50:13 bouyer Exp $ */
+/* $NetBSD: hdaudio.c,v 1.4.4.4 2010/11/21 20:18:41 riz Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd supp...@precedence.co.uk
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hdaudio.c,v 1.4.4.3 2009/10/18 16:50:13 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: hdaudio.c,v 1.4.4.4 2010/11/21 20:18:41 riz Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -668,6 +668,10 @@
 	snc = hdaudio_command(co, 0, CORB_GET_PARAMETER,
 	COP_SUBORDINATE_NODE_COUNT);
 
+	/* make sure the vendor and product IDs are valid */
+	if (vid == 0x || vid == 0x)
+		return;
+
 #ifdef HDAUDIO_DEBUG
 	hda_print(sc, Codec%02X: %04X:%04X HDA %d.%d rev %d stepping %d\n,
 	co-co_addr, vid  16, vid  0x,

Index: src/sys/dev/pci/hdaudio/hdaudio_afg.c
diff -u src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.6 src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.7
--- src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.6	Thu Jan 21 08:38:45 2010
+++ src/sys/dev/pci/hdaudio/hdaudio_afg.c	Sun Nov 21 20:18:41 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_afg.c,v 1.14.2.6 2010/01/21 08:38:45 snj Exp $ */
+/* $NetBSD: hdaudio_afg.c,v 1.14.2.7 2010/11/21 20:18:41 riz Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd supp...@precedence.co.uk
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hdaudio_afg.c,v 1.14.2.6 2010/01/21 08:38:45 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: hdaudio_afg.c,v 1.14.2.7 2010/11/21 20:18:41 riz Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -3330,7 +3330,7 @@
 	}
 
 	/* Multiple of 128 */
-	blksize = ~128;
+	blksize = ~127;
 	if (blksize = 0)
 		blksize = 128;
 
@@ -3338,7 +3338,7 @@
 	if (bufsize  HDAUDIO_BDL_MAX * blksize) {
 		blksize = bufsize / HDAUDIO_BDL_MAX;
 		if (blksize  128)
-			blksize = (blksize + 128)  ~128;
+			blksize = (blksize + 128)  ~127;
 	}
 
 	return blksize;
@@ -3552,7 +3552,7 @@
 hdaudio_afg_round_buffersize(void *opaque, int direction, size_t bufsize)
 {
 	/* Multiple of 128 */
-	bufsize = ~128;
+	bufsize = ~127;
 	if (bufsize = 0)
 		bufsize = 128;
 	return bufsize;

Index: src/sys/dev/pci/hdaudio/hdaudio_pci.c
diff -u src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.2.4.2 src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.2.4.3
--- src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.2.4.2	Sat Sep 26 19:52:10 2009
+++ src/sys/dev/pci/hdaudio/hdaudio_pci.c	Sun Nov 21 20:18:41 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_pci.c,v 1.2.4.2 2009/09/26 19:52:10 snj Exp $ */
+/* $NetBSD: hdaudio_pci.c,v 1.2.4.3 2010/11/21 20:18:41 riz Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd supp...@precedence.co.uk
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hdaudio_pci.c,v 1.2.4.2 2009/09/26 19:52:10 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: hdaudio_pci.c,v 1.2.4.3 2010/11/21 20:18:41 riz Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -49,6 +49,7 @@
 
 #include dev/pci/hdaudio/hdaudioreg.h
 #include dev/pci/hdaudio/hdaudiovar.h
+#include dev/pci/hdaudio/hdaudio_pci.h
 
 struct hdaudio_pci_softc {
 	struct hdaudio_softc	sc_hdaudio;	/* must be first */
@@ -153,6 +154,18 @@
 	if (!pmf_device_register(self, NULL, hdaudio_pci_resume))
 		aprint_error_dev(self, couldn't establish power handler\n);
 
+	switch (PCI_VENDOR(pa-pa_id)) {
+	case PCI_VENDOR_NVIDIA:
+		/* enable snooping */
+		csr = pci_conf_read(sc-sc_pc, sc-sc_tag,
+		

CVS commit: [netbsd-5] src/sys/dev/pci/hdaudio

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 20:22:46 UTC 2010

Modified Files:
src/sys/dev/pci/hdaudio [netbsd-5]: hdaudio_afg.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1442):
sys/dev/pci/hdaudio/hdaudio_afg.c: revision 1.25
kern/43542: 32kHz playback sounds like hissing analog TV snow
Instead of specifying a range of supported sample rates based on the lowest
and highest available frequencies, only advertise rates that the codec reports
as working. Let aurateconv take care of the rest.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.7 -r1.14.2.8 src/sys/dev/pci/hdaudio/hdaudio_afg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/hdaudio/hdaudio_afg.c
diff -u src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.7 src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.8
--- src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.7	Sun Nov 21 20:18:41 2010
+++ src/sys/dev/pci/hdaudio/hdaudio_afg.c	Sun Nov 21 20:22:46 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_afg.c,v 1.14.2.7 2010/11/21 20:18:41 riz Exp $ */
+/* $NetBSD: hdaudio_afg.c,v 1.14.2.8 2010/11/21 20:22:46 riz Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd supp...@precedence.co.uk
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hdaudio_afg.c,v 1.14.2.7 2010/11/21 20:18:41 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: hdaudio_afg.c,v 1.14.2.8 2010/11/21 20:22:46 riz Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -108,6 +108,11 @@
 
 #define	HDAUDIO_HP_SENSE_PERIOD		hz
 
+const u_int hdaudio_afg_possible_rates[] = {
+	8000, 11025, 16000, 22050, 32000, 44100,
+	48000, 88200, 96000, 176500, 192000, /* 384000, */
+};
+
 static const char *hdaudio_afg_mixer_names[] = HDAUDIO_DEVICE_NAMES;
 
 static const char *hdaudio_afg_port_connectivity[] = {
@@ -2845,9 +2850,10 @@
 
 static bool
 hdaudio_afg_probe_encoding(struct hdaudio_afg_softc *sc,
-u_int minrate, u_int maxrate, u_int validbits, u_int precision, bool force)
+u_int validbits, u_int precision, bool force)
 {
 	struct audio_format f;
+	int i;
 
 	if (!force  hdaudio_afg_bits_supported(sc, validbits) == false)
 		return false;
@@ -2861,8 +2867,11 @@
 	f.channels = 0;
 	f.channel_mask = 0;
 	f.frequency_type = 0;
-	f.frequency[0] = minrate;
-	f.frequency[1] = maxrate;
+	for (i = 0; i  __arraycount(hdaudio_afg_possible_rates); i++) {
+		u_int rate = hdaudio_afg_possible_rates[i];
+		if (hdaudio_afg_rate_supported(sc, rate))
+			f.frequency[f.frequency_type++] = rate;
+	}
 
 #define HDAUDIO_INITFMT(ch, chmask)			\
 	do {		\
@@ -2895,17 +2904,11 @@
 static void
 hdaudio_afg_configure_encodings(struct hdaudio_afg_softc *sc)
 {
-	const u_int possible_rates[] = {
-		8000, 11025, 16000, 22050, 32000, 44100,
-		48000, 88200, 96000, 176500, 192000, /* 384000, */
-	};
 	struct hdaudio_assoc *as = sc-sc_assocs;
 	struct audio_format f;
-	u_int minrate, maxrate;
 	int nchan, i;
 
 	sc-sc_pchan = sc-sc_rchan = 0;
-	minrate = maxrate = 0;
 
 	for (nchan = 0, i = 0; i  sc-sc_nassocs; i++) {
 		nchan = hdaudio_afg_assoc_count_channels(sc, as[i],
@@ -2921,34 +2924,24 @@
 	}
 	hda_print(sc, %dch/%dch, sc-sc_pchan, sc-sc_rchan);
 
-	for (i = 0; __arraycount(possible_rates); i++)
-		if (hdaudio_afg_rate_supported(sc, possible_rates[i])) {
-			minrate = possible_rates[i];
-			break;
-		}
-	for (i = __arraycount(possible_rates) - 1; i = 0; i--)
-		if (hdaudio_afg_rate_supported(sc, possible_rates[i])) {
-			maxrate = possible_rates[i];
-			break;
-		}
-	KASSERT(minrate  0  maxrate  0);	/* impossible */
-	hda_print1(sc,  %uHz, minrate);
-	if (minrate != maxrate)
-		hda_print1(sc, -%uHz, maxrate);
+	for (i = 0; i  __arraycount(hdaudio_afg_possible_rates); i++)
+		if (hdaudio_afg_rate_supported(sc,
+		hdaudio_afg_possible_rates[i]))
+			hda_print1(sc,  %uHz, hdaudio_afg_possible_rates[i]);
 
-	if (hdaudio_afg_probe_encoding(sc, minrate, maxrate, 8, 16, false))
+	if (hdaudio_afg_probe_encoding(sc, 8, 16, false))
 		hda_print1(sc,  8/16);
-	if (hdaudio_afg_probe_encoding(sc, minrate, maxrate, 16, 16, false))
+	if (hdaudio_afg_probe_encoding(sc, 16, 16, false))
 		hda_print1(sc,  16/16);
-	if (hdaudio_afg_probe_encoding(sc, minrate, maxrate, 20, 32, false))
+	if (hdaudio_afg_probe_encoding(sc, 20, 32, false))
 		hda_print1(sc,  20/32);
-	if (hdaudio_afg_probe_encoding(sc, minrate, maxrate, 24, 32, false))
+	if (hdaudio_afg_probe_encoding(sc, 24, 32, false))
 		hda_print1(sc,  24/32);
-	if (hdaudio_afg_probe_encoding(sc, minrate, maxrate, 32, 32, false))
+	if (hdaudio_afg_probe_encoding(sc, 32, 32, false))
 		hda_print1(sc,  32/32);
 
 	if (sc-sc_audiodev.ad_nformats == 0) {
-		hdaudio_afg_probe_encoding(sc, minrate, maxrate, 16, 16, true);
+		hdaudio_afg_probe_encoding(sc, 16, 16, true);
 		hda_print1(sc,  16/16*);
 	}
 



CVS commit: [netbsd-5] src/sys/dev/ic

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 21:02:49 UTC 2010

Modified Files:
src/sys/dev/ic [netbsd-5]: ciss.c

Log Message:
Pull up following revision(s) (requested by pettai in ticket #1452):
sys/dev/ic/ciss.c: revision 1.23
Fix a performance problem with the ciss(4) driver.  NetBSD does common
queueing at the scsipi midlayer, and if the midlayer is not requested to
enable tagged queueing, the midlayer will only queue one command to the
adapter driver for each device.  The SmartArray adapter is capable of
handling multiple commands, and in the rather common case where there is
no battery backup and no write cache, doing single write commands is very
slow.  The SmartArray adapter runs much better when several commands can
be issued to a device.
This has been observed and discussed in several list threads, notably:
http://mail-index.NetBSD.org/netbsd-users/2008/10/01/msg002083.html
http://mail-index.NetBSD.org/tech-kern/2008/11/30/msg003704.html
This also addresses PR kern/39686.
To enable tagged queueing, the adapter driver responds to the midlayer
request to set the transfer mode.  However, the SmartArray does not respond
to the SCSI INQUIRY command with an ANSII field of 2 or more, so the
scsipi midlayer will ignore the CmdQue bit in the flags3 field of the
inquiry data.  This fix will patch the inquiry data so set the ANSII field
to 2, and responds to the midlayer request to set the transfer mode by
requesting tagged queueing.
In addition, the original port of the driver did not set up the adapter
parameters correctly as mentioned in the second list thread mentioned
above.  The adapt_openings is the total number of commands that the
adapter will accept rather than the number of commands divided by the
number of logical drives.  Also, the adapt_max_periph is the maximum number
of commands which can be queued per peripheral device, not the number of
logical drives [which in the case of a single logical drive limited the
number of commands queued to 1].
I'm also suppressing an error message for invalid commands if the error
was due to the SCSI_SYNCHRONIZE_CACHE_10 command, since that command is
not supported by the SmartArray adapter, but used with wapbl(4) meta-data
journaling.  Setting the ANSII version to 2 to allow enabling tagged queueing
also enables the use of the SCSI_SYNCHRONIZE_CACHE_10 command.


To generate a diff of this commit:
cvs rdiff -u -r1.14.4.1 -r1.14.4.2 src/sys/dev/ic/ciss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ciss.c
diff -u src/sys/dev/ic/ciss.c:1.14.4.1 src/sys/dev/ic/ciss.c:1.14.4.2
--- src/sys/dev/ic/ciss.c:1.14.4.1	Sun Jul 26 18:33:35 2009
+++ src/sys/dev/ic/ciss.c	Sun Nov 21 21:02:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss.c,v 1.14.4.1 2009/07/26 18:33:35 snj Exp $	*/
+/*	$NetBSD: ciss.c,v 1.14.4.2 2010/11/21 21:02:49 riz Exp $	*/
 /*	$OpenBSD: ciss.c,v 1.14 2006/03/13 16:02:23 mickey Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ciss.c,v 1.14.4.1 2009/07/26 18:33:35 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ciss.c,v 1.14.4.2 2010/11/21 21:02:49 riz Exp $);
 
 #include bio.h
 
@@ -41,6 +41,7 @@
 #include dev/scsipi/scsi_all.h
 #include dev/scsipi/scsi_disk.h
 #include dev/scsipi/scsiconf.h
+#include dev/scsipi/scsipi_all.h
 
 #include dev/ic/cissreg.h
 #include dev/ic/cissvar.h
@@ -363,7 +364,7 @@
 	sc-sc_channel.chan_channel = 0;
 	sc-sc_channel.chan_ntargets = sc-maxunits;
 	sc-sc_channel.chan_nluns = 1;	/* ciss doesn't really have SCSI luns */
-	sc-sc_channel.chan_openings = sc-maxcmd / (sc-maxunits? sc-maxunits : 1);
+	sc-sc_channel.chan_openings = sc-maxcmd;
 #if NBIO  0
 	/* XXX Reserve some ccb's for sensor and bioctl. */
 	if (sc-sc_channel.chan_openings  2)
@@ -374,7 +375,7 @@
 
 	sc-sc_adapter.adapt_dev = (struct device *) sc;
 	sc-sc_adapter.adapt_openings = sc-sc_channel.chan_openings;
-	sc-sc_adapter.adapt_max_periph = sc-maxunits;
+	sc-sc_adapter.adapt_max_periph = sc-sc_channel.chan_openings;
 	sc-sc_adapter.adapt_request = ciss_scsi_cmd;
 	sc-sc_adapter.adapt_minphys = cissminphys;
 	sc-sc_adapter.adapt_ioctl = ciss_scsi_ioctl;
@@ -618,6 +619,14 @@
 	if (xs) {
 		xs-resid = 0;
 		CISS_DPRINTF(CISS_D_CMD, (scsipi_done(%p) , xs));
+		if (xs-cmd-opcode == INQUIRY) {
+			struct scsipi_inquiry_data *inq;
+			inq = (struct scsipi_inquiry_data *)xs-data;
+			if ((inq-version  SID_ANSII) == 0 
+			(inq-flags3  SID_CmdQue) != 0) {
+inq-version |= 2;
+			}
+		}
 		scsipi_done(xs);
 	}
 
@@ -637,9 +646,11 @@
 		break;
 
 	case CISS_ERR_INVCMD:
-		printf(%s: invalid cmd 0x%x: 0x%x is not valid @ 0x%x[%d]\n,
-		device_xname(sc-sc_dev), ccb-ccb_cmd.id,
-		err-err_info, err-err_type[3], err-err_type[2]);
+		if (xs == NULL ||
+		xs-cmd-opcode != SCSI_SYNCHRONIZE_CACHE_10)
+			printf(%s: invalid cmd 0x%x: 0x%x is not valid @ 0x%x[%d]\n,
+			

CVS commit: [netbsd-5] src/sys/dev/dkwedge

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 18:50:17 UTC 2010

Modified Files:
src/sys/dev/dkwedge [netbsd-5]: dk.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1435):
sys/dev/dkwedge/dk.c: revision 1.57
Make sure to release sc_parent-dk_rawlock before calling
vn_close(sc-sc_parent-dk_rawvp). Avoids a lockdebug panic:
error: mutex_destroy: assertion failed: !MUTEX_OWNED(mtx-mtx_owner)  
!MUTEX_HAS_WAITERS(mtx)
when the parent is a raidframe device.
See also:
http://mail-index.netbsd.org/tech-kern/2010/07/27/msg008612.html


To generate a diff of this commit:
cvs rdiff -u -r1.42.6.2 -r1.42.6.3 src/sys/dev/dkwedge/dk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/dkwedge/dk.c
diff -u src/sys/dev/dkwedge/dk.c:1.42.6.2 src/sys/dev/dkwedge/dk.c:1.42.6.3
--- src/sys/dev/dkwedge/dk.c:1.42.6.2	Sat Jan 30 19:00:46 2010
+++ src/sys/dev/dkwedge/dk.c	Sun Nov 21 18:50:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dk.c,v 1.42.6.2 2010/01/30 19:00:46 snj Exp $	*/
+/*	$NetBSD: dk.c,v 1.42.6.3 2010/11/21 18:50:17 riz Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dk.c,v 1.42.6.2 2010/01/30 19:00:46 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: dk.c,v 1.42.6.3 2010/11/21 18:50:17 riz Exp $);
 
 #include opt_dkwedge.h
 
@@ -476,17 +476,18 @@
 
 	/* Clean up the parent. */
 	mutex_enter(sc-sc_dk.dk_openlock);
-	mutex_enter(sc-sc_parent-dk_rawlock);
 	if (sc-sc_dk.dk_openmask) {
+		mutex_enter(sc-sc_parent-dk_rawlock);
 		if (sc-sc_parent-dk_rawopens-- == 1) {
 			KASSERT(sc-sc_parent-dk_rawvp != NULL);
+			mutex_exit(sc-sc_parent-dk_rawlock);
 			(void) vn_close(sc-sc_parent-dk_rawvp, FREAD | FWRITE,
 			NOCRED);
 			sc-sc_parent-dk_rawvp = NULL;
-		}
+		} else
+			mutex_exit(sc-sc_parent-dk_rawlock);
 		sc-sc_dk.dk_openmask = 0;
 	}
-	mutex_exit(sc-sc_parent-dk_rawlock);
 	mutex_exit(sc-sc_dk.dk_openlock);
 
 	/* Announce our departure. */
@@ -968,7 +969,6 @@
 	KASSERT(sc-sc_dk.dk_openmask != 0);
 
 	mutex_enter(sc-sc_dk.dk_openlock);
-	mutex_enter(sc-sc_parent-dk_rawlock);
 
 	if (fmt == S_IFCHR)
 		sc-sc_dk.dk_copenmask = ~1;
@@ -978,15 +978,17 @@
 	sc-sc_dk.dk_copenmask | sc-sc_dk.dk_bopenmask;
 
 	if (sc-sc_dk.dk_openmask == 0) {
+		mutex_enter(sc-sc_parent-dk_rawlock);
 		if (sc-sc_parent-dk_rawopens-- == 1) {
 			KASSERT(sc-sc_parent-dk_rawvp != NULL);
+			mutex_exit(sc-sc_parent-dk_rawlock);
 			error = vn_close(sc-sc_parent-dk_rawvp,
 			FREAD | FWRITE, NOCRED);
 			sc-sc_parent-dk_rawvp = NULL;
-		}
+		} else
+			mutex_exit(sc-sc_parent-dk_rawlock);
 	}
 
-	mutex_exit(sc-sc_parent-dk_rawlock);
 	mutex_exit(sc-sc_dk.dk_openlock);
 
 	return (error);



CVS commit: [netbsd-5] src/sys/dev

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 21:44:07 UTC 2010

Modified Files:
src/sys/dev/acpi [netbsd-5]: wb_acpi.c
src/sys/dev/ic [netbsd-5]: w83l518d.c w83l518d_sdmmc.c w83l518d_sdmmc.h
w83l518dvar.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1462):
sys/dev/acpi/wb_acpi.c: revision 1.3
sys/dev/ic/w83l518d_sdmmc.c: revision 1.2
sys/dev/ic/w83l518d_sdmmc.h: revision 1.2
sys/dev/ic/w83l518d.c: revision 1.2
sys/dev/ic/w83l518dvar.h: revision 1.2
add suspend/resume support
add pmf support


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/acpi/wb_acpi.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/ic/w83l518d.c \
src/sys/dev/ic/w83l518d_sdmmc.c src/sys/dev/ic/w83l518d_sdmmc.h \
src/sys/dev/ic/w83l518dvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/wb_acpi.c
diff -u src/sys/dev/acpi/wb_acpi.c:1.1.2.2 src/sys/dev/acpi/wb_acpi.c:1.1.2.3
--- src/sys/dev/acpi/wb_acpi.c:1.1.2.2	Thu Oct  8 09:47:09 2009
+++ src/sys/dev/acpi/wb_acpi.c	Sun Nov 21 21:44:07 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wb_acpi.c,v 1.1.2.2 2009/10/08 09:47:09 sborrill Exp $ */
+/* $NetBSD: wb_acpi.c,v 1.1.2.3 2010/11/21 21:44:07 riz Exp $ */
 
 /*
  * Copyright (c) 2009 Jared D. McNeill jmcne...@invisible.ca
@@ -26,38 +26,39 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wb_acpi.c,v 1.1.2.2 2009/10/08 09:47:09 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: wb_acpi.c,v 1.1.2.3 2010/11/21 21:44:07 riz Exp $);
 
 #include sys/param.h
-#include sys/systm.h
-#include sys/errno.h
-#include sys/ioctl.h
-#include sys/syslog.h
 #include sys/device.h
-#include sys/proc.h
-
-#include sys/bus.h
-
-#include dev/isa/isavar.h
-#include dev/isa/isadmavar.h
+#include sys/systm.h
 
-#include dev/acpi/acpica.h
 #include dev/acpi/acpireg.h
 #include dev/acpi/acpivar.h
 
-#include dev/sdmmc/sdmmcvar.h
 #include dev/ic/w83l518dvar.h
 #include dev/ic/w83l518dreg.h
 
+#include dev/isa/isadmavar.h
+
+#include dev/sdmmc/sdmmcvar.h
+
+#define _COMPONENT	ACPI_RESOURCE_COMPONENT
+ACPI_MODULE_NAME	(wb_acpi)
+
 static int	wb_acpi_match(device_t, cfdata_t, void *);
 static void	wb_acpi_attach(device_t, device_t, void *);
 static int	wb_acpi_detach(device_t, int);
+static bool	wb_acpi_suspend(device_t PMF_FN_PROTO);
+static bool	wb_acpi_resume(device_t PMF_FN_PROTO);
 
 struct wb_acpi_softc {
 	struct wb_softc sc_wb;
 	isa_chipset_tag_t sc_ic;
 	void *sc_ih;
 	int sc_ioh_length;
+
+	ACPI_HANDLE sc_crs, sc_srs;
+	ACPI_BUFFER sc_crs_buffer;
 };
 
 CFATTACH_DECL_NEW(wb_acpi, sizeof(struct wb_acpi_softc),
@@ -104,6 +105,16 @@
 	if (ACPI_FAILURE(rv))
 		return;
 
+	AcpiGetHandle(aa-aa_node-ad_handle, _CRS, sc-sc_crs);
+	AcpiGetHandle(aa-aa_node-ad_handle, _SRS, sc-sc_srs);
+	if (sc-sc_crs  sc-sc_srs) {
+		sc-sc_crs_buffer.Pointer = NULL;
+		sc-sc_crs_buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
+		rv = AcpiGetCurrentResources(sc-sc_crs, sc-sc_crs_buffer);
+		if (ACPI_FAILURE(rv))
+			sc-sc_crs = sc-sc_srs = NULL;
+	}
+
 	io = acpi_res_io(res, 0);
 	irq = acpi_res_irq(res, 0);
 	if (io == NULL || irq == NULL) {
@@ -133,6 +144,8 @@
 	sc-sc_wb.wb_irq = irq-ar_irq;
 	sc-sc_wb.wb_base = io-ar_base;
 	wb_attach(sc-sc_wb);
+
+	pmf_device_register(self, wb_acpi_suspend, wb_acpi_resume);
 	
 cleanup:
 	acpi_resource_cleanup(res);
@@ -144,6 +157,11 @@
 	struct wb_acpi_softc *sc = device_private(self);
 	int rv;
 
+	pmf_device_deregister(self);
+
+	if (sc-sc_crs_buffer.Pointer)
+		ACPI_FREE(sc-sc_crs_buffer.Pointer);
+
 	rv = wb_detach(sc-sc_wb, flags);
 	if (rv)
 		return rv;
@@ -157,3 +175,27 @@
 
 	return 0;
 }
+
+static bool
+wb_acpi_suspend(device_t self PMF_FN_ARGS)
+{
+	struct wb_acpi_softc *sc = device_private(self);
+
+	return wb_suspend(sc-sc_wb);
+}
+
+static bool
+wb_acpi_resume(device_t self PMF_FN_ARGS)
+{
+	struct wb_acpi_softc *sc = device_private(self);
+	ACPI_STATUS rv;
+
+	if (sc-sc_crs  sc-sc_srs) {
+		rv = AcpiSetCurrentResources(sc-sc_srs, sc-sc_crs_buffer);
+		if (ACPI_FAILURE(rv))
+			printf(%s: _SRS failed: %s\n,
+			device_xname(self), AcpiFormatException(rv));
+	}
+
+	return wb_resume(sc-sc_wb);
+}

Index: src/sys/dev/ic/w83l518d.c
diff -u src/sys/dev/ic/w83l518d.c:1.1.2.2 src/sys/dev/ic/w83l518d.c:1.1.2.3
--- src/sys/dev/ic/w83l518d.c:1.1.2.2	Thu Oct  8 09:47:09 2009
+++ src/sys/dev/ic/w83l518d.c	Sun Nov 21 21:44:07 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: w83l518d.c,v 1.1.2.2 2009/10/08 09:47:09 sborrill Exp $ */
+/* $NetBSD: w83l518d.c,v 1.1.2.3 2010/11/21 21:44:07 riz Exp $ */
 
 /*
  * Copyright (c) 2009 Jared D. McNeill jmcne...@invisible.ca
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: w83l518d.c,v 1.1.2.2 2009/10/08 09:47:09 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: w83l518d.c,v 1.1.2.3 2010/11/21 21:44:07 riz Exp $);
 
 #include sys/param.h
 

CVS commit: [netbsd-5] src/sys/dev/raidframe

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 22:06:54 UTC 2010

Modified Files:
src/sys/dev/raidframe [netbsd-5]: raidframevar.h rf_copyback.c
rf_disks.c rf_netbsdkintf.c rf_reconstruct.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1468):
sys/dev/raidframe/rf_disks.c: revision 1.74
sys/dev/raidframe/raidframevar.h: revision 1.14
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.275
sys/dev/raidframe/rf_copyback.c: revision 1.43
sys/dev/raidframe/rf_reconstruct.c: revision 1.109
add support for 2TB raid devices.
- - add two new members to the component label:
 u_int numBlocksHi
 u_int partitionSizeHi
  and store the top 32 bits of the real number of blocks and
  partition size.  modify rf_print_component_label(),
  rf_does_it_fit(), rf_AutoConfigureDisks() and
  rf_ReconstructFailedDiskBasic().
- - call disk_blocksize() after disk_attach() [ from mlelstv ]
- - shift the block number relative to DEV_BSHIFT in raidstart()
  and InitBP() so that accesses work for non 512-byte devices.
  [ from mlelstv ]
- - update rf_getdisksize() to use the new getdisksize() [ from
  mlelstv.  this part needs a separate change for netbsd-5. ]
reviewed by: oster, christos and darrenr


To generate a diff of this commit:
cvs rdiff -u -r1.12.10.1 -r1.12.10.2 src/sys/dev/raidframe/raidframevar.h
cvs rdiff -u -r1.41.20.1 -r1.41.20.2 src/sys/dev/raidframe/rf_copyback.c
cvs rdiff -u -r1.70.10.2 -r1.70.10.3 src/sys/dev/raidframe/rf_disks.c
cvs rdiff -u -r1.250.4.7 -r1.250.4.8 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.105.4.3 -r1.105.4.4 src/sys/dev/raidframe/rf_reconstruct.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/raidframe/raidframevar.h
diff -u src/sys/dev/raidframe/raidframevar.h:1.12.10.1 src/sys/dev/raidframe/raidframevar.h:1.12.10.2
--- src/sys/dev/raidframe/raidframevar.h:1.12.10.1	Thu Dec 10 22:59:16 2009
+++ src/sys/dev/raidframe/raidframevar.h	Sun Nov 21 22:06:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: raidframevar.h,v 1.12.10.1 2009/12/10 22:59:16 snj Exp $ */
+/*	$NetBSD: raidframevar.h,v 1.12.10.2 2010/11/21 22:06:53 riz Exp $ */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -471,7 +471,9 @@
  done first, (and would become raid0).
  This may be in conflict with last_unit!!?! */
 	  /* Not currently used. */
-	int future_use2[44];  /* More future expansion */
+	u_int numBlocksHi;/* The top 32-bits of the numBlocks member. */
+	u_int partitionSizeHi;/* The top 32-bits of the partitionSize member. */
+	int future_use2[42];  /* More future expansion */
 } RF_ComponentLabel_t;
 
 typedef struct RF_SingleComponent_s {

Index: src/sys/dev/raidframe/rf_copyback.c
diff -u src/sys/dev/raidframe/rf_copyback.c:1.41.20.1 src/sys/dev/raidframe/rf_copyback.c:1.41.20.2
--- src/sys/dev/raidframe/rf_copyback.c:1.41.20.1	Thu Dec 10 22:59:16 2009
+++ src/sys/dev/raidframe/rf_copyback.c	Sun Nov 21 22:06:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_copyback.c,v 1.41.20.1 2009/12/10 22:59:16 snj Exp $	*/
+/*	$NetBSD: rf_copyback.c,v 1.41.20.2 2010/11/21 22:06:53 riz Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -38,7 +38,7 @@
  /
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_copyback.c,v 1.41.20.1 2009/12/10 22:59:16 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_copyback.c,v 1.41.20.2 2010/11/21 22:06:53 riz Exp $);
 
 #include dev/raidframe/raidframevar.h
 
@@ -213,6 +213,7 @@
 	c_label-row = 0;
 	c_label-column = fcol;
 	c_label-partitionSize = raidPtr-Disks[fcol].partitionSize;
+	c_label-partitionSizeHi = raidPtr-Disks[fcol].partitionSize  32;
 
 	raidflush_component_label(raidPtr, fcol);
 

Index: src/sys/dev/raidframe/rf_disks.c
diff -u src/sys/dev/raidframe/rf_disks.c:1.70.10.2 src/sys/dev/raidframe/rf_disks.c:1.70.10.3
--- src/sys/dev/raidframe/rf_disks.c:1.70.10.2	Thu Dec 10 22:59:16 2009
+++ src/sys/dev/raidframe/rf_disks.c	Sun Nov 21 22:06:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_disks.c,v 1.70.10.2 2009/12/10 22:59:16 snj Exp $	*/
+/*	$NetBSD: rf_disks.c,v 1.70.10.3 2010/11/21 22:06:53 riz Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -60,7 +60,7 @@
  ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_disks.c,v 1.70.10.2 2009/12/10 22:59:16 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_disks.c,v 1.70.10.3 2010/11/21 22:06:53 riz Exp $);
 
 #include dev/raidframe/raidframevar.h
 
@@ -453,6 +453,8 @@
 			/* Found it.  Configure it.. */
 			diskPtr-blockSize = ac-clabel-blockSize;
 			diskPtr-numBlocks = ac-clabel-numBlocks;
+			diskPtr-numBlocks |=
+			(uint64_t)ac-clabel-numBlocksHi  32;
 	

CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 23:34:56 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: fwohci_pci.c

Log Message:
Pull up following revision(s) (requested by macallan in ticket #1470):
sys/dev/pci/fwohci_pci.c: revision 1.35
do not attach to Powrbook G3 onboard Firewire controllers until =20
someone with
access to the hardware can figure out why it deadlocks during device
discovery


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.10.1 src/sys/dev/pci/fwohci_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/fwohci_pci.c
diff -u src/sys/dev/pci/fwohci_pci.c:1.32 src/sys/dev/pci/fwohci_pci.c:1.32.10.1
--- src/sys/dev/pci/fwohci_pci.c:1.32	Mon Apr 28 20:23:54 2008
+++ src/sys/dev/pci/fwohci_pci.c	Sun Nov 21 23:34:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci_pci.c,v 1.32 2008/04/28 20:23:54 martin Exp $	*/
+/*	$NetBSD: fwohci_pci.c,v 1.32.10.1 2010/11/21 23:34:56 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwohci_pci.c,v 1.32 2008/04/28 20:23:54 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwohci_pci.c,v 1.32.10.1 2010/11/21 23:34:56 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -43,6 +43,7 @@
 
 #include dev/pci/pcireg.h
 #include dev/pci/pcivar.h
+#include dev/pci/pcidevs.h
 #include dev/ieee1394/fw_port.h
 #include dev/ieee1394/firewire.h
 #include dev/ieee1394/firewirereg.h
@@ -74,6 +75,15 @@
 {
 	struct pci_attach_args *pa = (struct pci_attach_args *) aux;
 
+	/*
+	 * XXX
+	 * Firewire controllers used in some G3 PowerBooks hang the system
+	 * when trying to discover devices - don't attach to those for now
+	 * until someone with the right hardware can investigate
+	 */
+	if ((PCI_VENDOR(pa-pa_id) == PCI_VENDOR_APPLE) 
+	(PCI_PRODUCT(pa-pa_id) == PCI_PRODUCT_APPLE_PBG3_FW))
+	return 0;
 	if (PCI_CLASS(pa-pa_class) == PCI_CLASS_SERIALBUS 
 	PCI_SUBCLASS(pa-pa_class) == PCI_SUBCLASS_SERIALBUS_FIREWIRE 
 	PCI_INTERFACE(pa-pa_class) == PCI_INTERFACE_OHCI)



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 23:41:21 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: aceride.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1471):
sys/dev/pci/aceride.c: revision 1.28
Add a workaround for 48-bit LBA DMA access bug on M5229 rev. = 0xc4.
- use DMA in 28-bit LBA addressing.
- use PIO in 48-bit LBA addressing.
Idea and message are from FreeBSD, and tested on M5229 rev. 0xc3 in
my Sun Netra X1 with 160GB drive.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.14.1 src/sys/dev/pci/aceride.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/aceride.c
diff -u src/sys/dev/pci/aceride.c:1.25 src/sys/dev/pci/aceride.c:1.25.14.1
--- src/sys/dev/pci/aceride.c:1.25	Tue Mar 18 20:46:36 2008
+++ src/sys/dev/pci/aceride.c	Sun Nov 21 23:41:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: aceride.c,v 1.25 2008/03/18 20:46:36 cube Exp $	*/
+/*	$NetBSD: aceride.c,v 1.25.14.1 2010/11/21 23:41:20 riz Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aceride.c,v 1.25 2008/03/18 20:46:36 cube Exp $);
+__KERNEL_RCSID(0, $NetBSD: aceride.c,v 1.25.14.1 2010/11/21 23:41:20 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -46,6 +46,7 @@
 static void acer_chip_map(struct pciide_softc*, struct pci_attach_args*);
 static void acer_setup_channel(struct ata_channel*);
 static int  acer_pci_intr(void *);
+static int  acer_dma_init(void *, int, int, void *, size_t, int);
 
 static int  aceride_match(device_t, cfdata_t, void *);
 static void aceride_attach(device_t, device_t, void *);
@@ -144,6 +145,12 @@
 sc-sc_wdcdev.sc_atac.atac_udma_cap = 2;
 		}
 		sc-sc_wdcdev.irqack = pciide_irqack;
+		if (rev = 0xc4) {
+			sc-sc_wdcdev.dma_init = acer_dma_init;
+			aprint_verbose_dev(sc-sc_wdcdev.sc_atac.atac_dev,
+			 using PIO transfers above 137GB as workaround for 
+			 48bit DMA access bug, expect reduced performance\n);
+		}
 	}
 
 	sc-sc_wdcdev.sc_atac.atac_pio_cap = 4;
@@ -375,3 +382,15 @@
 	}
 	return rv;
 }
+
+static int
+acer_dma_init(void *v, int channel, int drive, void *databuf,
+size_t datalen, int flags)
+{
+
+	/* use PIO for LBA48 transfer */
+	if (flags  WDC_DMA_LBA48)
+		return EINVAL;
+
+	return pciide_dma_init(v, channel, drive, databuf, datalen, flags);
+}



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Nov 22 03:39:08 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs

Log Message:
Pull up following revision(s) (requested by macallan in ticket #1470):
sys/dev/pci/pcidevs: revision 1.1019
sys/dev/pci/fwohci_pci.c: revision 1.35
do not attach to Powrbook G3 onboard Firewire controllers until =20
someone with
access to the hardware can figure out why it deadlocks during device
discovery
add Apple PowerBook G3 Firewire controllers


To generate a diff of this commit:
cvs rdiff -u -r1.962.4.14 -r1.962.4.15 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.962.4.14 src/sys/dev/pci/pcidevs:1.962.4.15
--- src/sys/dev/pci/pcidevs:1.962.4.14	Sat Nov 20 00:18:58 2010
+++ src/sys/dev/pci/pcidevs	Mon Nov 22 03:39:08 2010
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.14 2010/11/20 00:18:58 riz Exp $
+$NetBSD: pcidevs,v 1.962.4.15 2010/11/22 03:39:08 riz Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -976,6 +976,7 @@
 product APPLE BANDIT2		0x0008	Bandit Host-PCI Bridge
 product APPLE HEATHROW		0x0010	Heathrow I/O Controller
 product APPLE PADDINGTON	0x0017	Paddington I/O Controller
+product APPLE PBG3_FW		0x0018  PowerBook G3 Firewire
 product APPLE KEYLARGO_USB	0x0019	KeyLargo USB Controller
 product APPLE UNINORTH1		0x001e	UniNorth Host-PCI Bridge
 product APPLE UNINORTH2		0x001f	UniNorth Host-PCI Bridge



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Nov 22 03:40:11 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket 1470.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.14 -r1.963.4.15 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.14 -r1.962.4.15 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.14 src/sys/dev/pci/pcidevs.h:1.963.4.15
--- src/sys/dev/pci/pcidevs.h:1.963.4.14	Sat Nov 20 00:19:36 2010
+++ src/sys/dev/pci/pcidevs.h	Mon Nov 22 03:40:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.14 2010/11/20 00:19:36 riz Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.15 2010/11/22 03:40:00 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -983,6 +983,7 @@
 #define	PCI_PRODUCT_APPLE_BANDIT2	0x0008		/* Bandit Host-PCI Bridge */
 #define	PCI_PRODUCT_APPLE_HEATHROW	0x0010		/* Heathrow I/O Controller */
 #define	PCI_PRODUCT_APPLE_PADDINGTON	0x0017		/* Paddington I/O Controller */
+#define	PCI_PRODUCT_APPLE_PBG3_FW	0x0018		/* PowerBook G3 Firewire */
 #define	PCI_PRODUCT_APPLE_KEYLARGO_USB	0x0019		/* KeyLargo USB Controller */
 #define	PCI_PRODUCT_APPLE_UNINORTH1	0x001e		/* UniNorth Host-PCI Bridge */
 #define	PCI_PRODUCT_APPLE_UNINORTH2	0x001f		/* UniNorth Host-PCI Bridge */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.14 src/sys/dev/pci/pcidevs_data.h:1.962.4.15
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.14	Sat Nov 20 00:19:37 2010
+++ src/sys/dev/pci/pcidevs_data.h	Mon Nov 22 03:40:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.14 2010/11/20 00:19:37 riz Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.15 2010/11/22 03:40:00 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -3532,6 +3532,10 @@
 	Paddington I/O Controller,
 	},
 	{
+	PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_PBG3_FW,
+	PowerBook G3 Firewire,
+	},
+	{
 	PCI_VENDOR_APPLE, PCI_PRODUCT_APPLE_KEYLARGO_USB,
 	KeyLargo USB Controller,
 	},
@@ -14976,4 +14980,4 @@
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3143;
+const int pci_nproducts = 3144;



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 17:38:28 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: if_pcn.c

Log Message:
Pull up following revision(s) (requested by hubertf in ticket #1385):
sys/dev/pci/if_pcn.c: revision 1.51
silence boot -z


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.14.1 src/sys/dev/pci/if_pcn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_pcn.c
diff -u src/sys/dev/pci/if_pcn.c:1.46 src/sys/dev/pci/if_pcn.c:1.46.14.1
--- src/sys/dev/pci/if_pcn.c:1.46	Fri Apr  4 12:20:48 2008
+++ src/sys/dev/pci/if_pcn.c	Sat Nov 20 17:38:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_pcn.c,v 1.46 2008/04/04 12:20:48 tsutsui Exp $	*/
+/*	$NetBSD: if_pcn.c,v 1.46.14.1 2010/11/20 17:38:28 riz Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_pcn.c,v 1.46 2008/04/04 12:20:48 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_pcn.c,v 1.46.14.1 2010/11/20 17:38:28 riz Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -2037,12 +2037,12 @@
 
 #define	ADD(str, m, d)			\
 do {	\
-	printf(%s%s, sep, str);	\
+	aprint_normal(%s%s, sep, str);	\
 	ifmedia_add(sc-sc_mii.mii_media, IFM_ETHER|(m), (d), NULL);	\
 	sep = , ;			\
 } while (/*CONSTCOND*/0)
 
-	printf(%s: , device_xname(sc-sc_dev));
+	aprint_normal(%s: , device_xname(sc-sc_dev));
 	ADD(10base5, IFM_10_5, PORTSEL_AUI);
 	if (sc-sc_variant-pcv_chipid == PARTID_Am79c970A)
 		ADD(10base5-FDX, IFM_10_5|IFM_FDX, PORTSEL_AUI);
@@ -2052,7 +2052,7 @@
 	ADD(auto, IFM_AUTO, 0);
 	if (sc-sc_variant-pcv_chipid == PARTID_Am79c970A)
 		ADD(auto-FDX, IFM_AUTO|IFM_FDX, 0);
-	printf(\n);
+	aprint_normal(\n);
 
 	ifmedia_set(sc-sc_mii.mii_media, IFM_ETHER|IFM_AUTO);
 }



CVS commit: [netbsd-5] src/sys/dev/ic

2010-11-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 18:20:49 UTC 2010

Modified Files:
src/sys/dev/ic [netbsd-5]: esiop.c siop.c

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #1390):
sys/dev/ic/siop.c: revision 1.95
sys/dev/ic/esiop.c: revision 1.52
Improve error paths in (e)siop_scsipi_request():
  - When terminating the adapter request after the cmd has been removed
from the free list, put that cmd back on the free list before returing.
  - Correctly indicate which bus_dma_load() failed.
Analysis and fix from Michael L. Hitch in PR/42844.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.14.1 src/sys/dev/ic/esiop.c
cvs rdiff -u -r1.87 -r1.87.14.1 src/sys/dev/ic/siop.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/esiop.c
diff -u src/sys/dev/ic/esiop.c:1.42 src/sys/dev/ic/esiop.c:1.42.14.1
--- src/sys/dev/ic/esiop.c:1.42	Tue Apr  8 12:07:26 2008
+++ src/sys/dev/ic/esiop.c	Sat Nov 20 18:20:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: esiop.c,v 1.42 2008/04/08 12:07:26 cegger Exp $	*/
+/*	$NetBSD: esiop.c,v 1.42.14.1 2010/11/20 18:20:49 riz Exp $	*/
 
 /*
  * Copyright (c) 2002 Manuel Bouyer.
@@ -33,7 +33,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: esiop.c,v 1.42 2008/04/08 12:07:26 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: esiop.c,v 1.42.14.1 2010/11/20 18:20:49 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1556,6 +1556,8 @@
 target %d\n, target);
 xs-error = XS_RESOURCE_SHORTAGE;
 scsipi_done(xs);
+TAILQ_INSERT_TAIL(sc-free_list,
+esiop_cmd, next);
 splx(s);
 return;
 			}
@@ -1582,6 +1584,8 @@
 target, lun);
 xs-error = XS_RESOURCE_SHORTAGE;
 scsipi_done(xs);
+TAILQ_INSERT_TAIL(sc-free_list,
+esiop_cmd, next);
 splx(s);
 return;
 			}
@@ -1598,8 +1602,11 @@
 		if (error) {
 			aprint_error_dev(sc-sc_c.sc_dev, unable to load cmd DMA map: %d\n,
 			error);
-			xs-error = XS_DRIVER_STUFFUP;
+			xs-error = (error == EAGAIN) ?
+			XS_RESOURCE_SHORTAGE : XS_DRIVER_STUFFUP;
 			scsipi_done(xs);
+			esiop_cmd-cmd_c.status = CMDST_FREE;
+			TAILQ_INSERT_TAIL(sc-free_list, esiop_cmd, next);
 			splx(s);
 			return;
 		}
@@ -1610,12 +1617,17 @@
 			((xs-xs_control  XS_CTL_DATA_IN) ?
 			 BUS_DMA_READ : BUS_DMA_WRITE));
 			if (error) {
-aprint_error_dev(sc-sc_c.sc_dev, unable to load cmd DMA map: %d,
+aprint_error_dev(sc-sc_c.sc_dev,
+unable to load data DMA map: %d,
 error);
-xs-error = XS_DRIVER_STUFFUP;
+xs-error = (error == EAGAIN) ?
+XS_RESOURCE_SHORTAGE : XS_DRIVER_STUFFUP;
 scsipi_done(xs);
 bus_dmamap_unload(sc-sc_c.sc_dmat,
 esiop_cmd-cmd_c.dmamap_cmd);
+esiop_cmd-cmd_c.status = CMDST_FREE;
+TAILQ_INSERT_TAIL(sc-free_list,
+esiop_cmd, next);
 splx(s);
 return;
 			}

Index: src/sys/dev/ic/siop.c
diff -u src/sys/dev/ic/siop.c:1.87 src/sys/dev/ic/siop.c:1.87.14.1
--- src/sys/dev/ic/siop.c:1.87	Tue Apr  8 12:07:27 2008
+++ src/sys/dev/ic/siop.c	Sat Nov 20 18:20:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: siop.c,v 1.87 2008/04/08 12:07:27 cegger Exp $	*/
+/*	$NetBSD: siop.c,v 1.87.14.1 2010/11/20 18:20:49 riz Exp $	*/
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -33,7 +33,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: siop.c,v 1.87 2008/04/08 12:07:27 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: siop.c,v 1.87.14.1 2010/11/20 18:20:49 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1282,6 +1282,8 @@
 target %d\n, target);
 xs-error = XS_RESOURCE_SHORTAGE;
 scsipi_done(xs);
+TAILQ_INSERT_TAIL(sc-free_list,
+siop_cmd, next);
 splx(s);
 return;
 			}
@@ -1301,6 +1303,8 @@
 target);
 xs-error = XS_RESOURCE_SHORTAGE;
 scsipi_done(xs);
+TAILQ_INSERT_TAIL(sc-free_list,
+siop_cmd, next);
 splx(s);
 return;
 			}
@@ -1318,6 +1322,8 @@
 target, lun);
 xs-error = XS_RESOURCE_SHORTAGE;
 scsipi_done(xs);
+TAILQ_INSERT_TAIL(sc-free_list,
+siop_cmd, next);
 splx(s);
 return;
 			}
@@ -1334,8 +1340,11 @@
 		if (error) {
 			aprint_error_dev(sc-sc_c.sc_dev, unable to load cmd DMA map: %d\n,
 			error);
-			xs-error = XS_DRIVER_STUFFUP;
+			xs-error = (error == EAGAIN) ?
+			XS_RESOURCE_SHORTAGE : XS_DRIVER_STUFFUP;
 			scsipi_done(xs);
+			siop_cmd-cmd_c.status = CMDST_FREE;
+			TAILQ_INSERT_TAIL(sc-free_list, siop_cmd, next);
 			splx(s);
 			return;
 		}
@@ -1346,12 +1355,17 @@
 			((xs-xs_control  XS_CTL_DATA_IN) ?
 			 BUS_DMA_READ : BUS_DMA_WRITE));
 			if (error) {
-aprint_error_dev(sc-sc_c.sc_dev, unable to load cmd DMA map: %d,
+aprint_error_dev(sc-sc_c.sc_dev,
+unable to load data DMA map: 

CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 18:23:20 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: piixpm.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1391):
sys/dev/pci/piixpm.c: revision 1.28
Fix dmesg output:
Old:
piixpm0 at pci0 dev 20 function 0
piixpm0: ATI Technologies SB600/SB700/SB800 SMBus Controller (rev. 0x13)
piixpm0: interrupting at SMIpiixpm0: polling
New:
piixpm0 at pci0 dev 20 function 0
piixpm0: ATI Technologies SB600/SB700/SB800 SMBus Controller (rev. 0x13)
piixpm0: interrupting at SMI, polling
Cosmetic change only, no functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/dev/pci/piixpm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.26 src/sys/dev/pci/piixpm.c:1.26.4.1
--- src/sys/dev/pci/piixpm.c:1.26	Sun Oct 12 19:01:01 2008
+++ src/sys/dev/pci/piixpm.c	Sat Nov 20 18:23:20 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.26 2008/10/12 19:01:01 martin Exp $ */
+/* $NetBSD: piixpm.c,v 1.26.4.1 2010/11/20 18:23:20 riz Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: piixpm.c,v 1.26 2008/10/12 19:01:01 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: piixpm.c,v 1.26.4.1 2010/11/20 18:23:20 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -204,9 +204,10 @@
 	}
 
 	sc-sc_poll = 1;
+	aprint_normal_dev(self, );
 	if ((conf  PIIX_SMB_HOSTC_INTMASK) == PIIX_SMB_HOSTC_SMI) {
 		/* No PCI IRQ */
-		aprint_normal_dev(self, interrupting at SMI);
+		aprint_normal(interrupting at SMI, );
 	} else if ((conf  PIIX_SMB_HOSTC_INTMASK) == PIIX_SMB_HOSTC_IRQ) {
 		/* Install interrupt handler */
 		if (pci_intr_map(pa, ih) == 0) {
@@ -214,14 +215,13 @@
 			sc-sc_smb_ih = pci_intr_establish(pa-pa_pc, ih, IPL_BIO,
 			piixpm_intr, sc);
 			if (sc-sc_smb_ih != NULL) {
-aprint_normal_dev(self, interrupting at %s,
-intrstr);
+aprint_normal(interrupting at %s, intrstr);
 sc-sc_poll = 0;
 			}
 		}
 	}
 	if (sc-sc_poll)
-		aprint_normal_dev(self, polling);
+		aprint_normal(polling);
 
 	aprint_normal(\n);
 



CVS commit: [netbsd-5] src/sys/dev/ic

2010-11-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 20:12:57 UTC 2010

Modified Files:
src/sys/dev/ic [netbsd-5]: esiop.c siop.c

Log Message:
Fix patch from ticket 1390; bad merge from -current to netbsd-5.


To generate a diff of this commit:
cvs rdiff -u -r1.42.14.1 -r1.42.14.2 src/sys/dev/ic/esiop.c
cvs rdiff -u -r1.87.14.1 -r1.87.14.2 src/sys/dev/ic/siop.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/esiop.c
diff -u src/sys/dev/ic/esiop.c:1.42.14.1 src/sys/dev/ic/esiop.c:1.42.14.2
--- src/sys/dev/ic/esiop.c:1.42.14.1	Sat Nov 20 18:20:49 2010
+++ src/sys/dev/ic/esiop.c	Sat Nov 20 20:12:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: esiop.c,v 1.42.14.1 2010/11/20 18:20:49 riz Exp $	*/
+/*	$NetBSD: esiop.c,v 1.42.14.2 2010/11/20 20:12:56 riz Exp $	*/
 
 /*
  * Copyright (c) 2002 Manuel Bouyer.
@@ -33,7 +33,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: esiop.c,v 1.42.14.1 2010/11/20 18:20:49 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: esiop.c,v 1.42.14.2 2010/11/20 20:12:56 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1617,7 +1617,7 @@
 			((xs-xs_control  XS_CTL_DATA_IN) ?
 			 BUS_DMA_READ : BUS_DMA_WRITE));
 			if (error) {
-aprint_error_dev(sc-sc_c.sc_dev,
+aprint_error_dev(sc-sc_c.sc_dev,
 unable to load data DMA map: %d,
 error);
 xs-error = (error == EAGAIN) ?

Index: src/sys/dev/ic/siop.c
diff -u src/sys/dev/ic/siop.c:1.87.14.1 src/sys/dev/ic/siop.c:1.87.14.2
--- src/sys/dev/ic/siop.c:1.87.14.1	Sat Nov 20 18:20:49 2010
+++ src/sys/dev/ic/siop.c	Sat Nov 20 20:12:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: siop.c,v 1.87.14.1 2010/11/20 18:20:49 riz Exp $	*/
+/*	$NetBSD: siop.c,v 1.87.14.2 2010/11/20 20:12:56 riz Exp $	*/
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -33,7 +33,7 @@
 /* SYM53c7/8xx PCI-SCSI I/O Processors driver */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: siop.c,v 1.87.14.1 2010/11/20 18:20:49 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: siop.c,v 1.87.14.2 2010/11/20 20:12:56 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1355,7 +1355,7 @@
 			((xs-xs_control  XS_CTL_DATA_IN) ?
 			 BUS_DMA_READ : BUS_DMA_WRITE));
 			if (error) {
-aprint_error_dev(sc-sc_c.sc_dev,
+aprint_error_dev(sc-sc_c.sc_dev,
 unable to load data DMA map: %d,
 error);
 xs-error = (error == EAGAIN) ?



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 20:56:46 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: aac_pci.c

Log Message:
Pull up following revision(s) (requested by is in ticket #1394):
sys/dev/pci/aac_pci.c: revision 1.31
SUN X4140's version of this board. From FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.25.8.1 -r1.25.8.2 src/sys/dev/pci/aac_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/aac_pci.c
diff -u src/sys/dev/pci/aac_pci.c:1.25.8.1 src/sys/dev/pci/aac_pci.c:1.25.8.2
--- src/sys/dev/pci/aac_pci.c:1.25.8.1	Thu Jan  8 21:51:10 2009
+++ src/sys/dev/pci/aac_pci.c	Sat Nov 20 20:56:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: aac_pci.c,v 1.25.8.1 2009/01/08 21:51:10 snj Exp $	*/
+/*	$NetBSD: aac_pci.c,v 1.25.8.2 2010/11/20 20:56:46 riz Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aac_pci.c,v 1.25.8.1 2009/01/08 21:51:10 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: aac_pci.c,v 1.25.8.2 2010/11/20 20:56:46 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -398,6 +398,14 @@
 		0,
 		HP NetRAID-4M
 	},
+	{	0x9005,
+		0x0285,
+		0x108e,
+		0x286,
+		AAC_HWIF_I960RX,
+		0,
+		SG-XPCIESAS-R-IN
+	},
 };
 
 static const struct aac_ident *



CVS commit: [netbsd-5] src/sys/dev/usb

2010-11-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 02:38:07 UTC 2010

Modified Files:
src/sys/dev/usb [netbsd-5]: ukbdmap.c

Log Message:
Pull up following patch (requested by ahoka in ticket #1399):
sys/dev/usb/ukbdmap.c : patch
Enable Hungarian keyboard layout on USB keyboards.


To generate a diff of this commit:
cvs rdiff -u -r1.20.8.1 -r1.20.8.2 src/sys/dev/usb/ukbdmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ukbdmap.c
diff -u src/sys/dev/usb/ukbdmap.c:1.20.8.1 src/sys/dev/usb/ukbdmap.c:1.20.8.2
--- src/sys/dev/usb/ukbdmap.c:1.20.8.1	Mon Feb 16 03:22:04 2009
+++ src/sys/dev/usb/ukbdmap.c	Sun Nov 21 02:38:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ukbdmap.c,v 1.20.8.1 2009/02/16 03:22:04 snj Exp $	*/
+/*	$NetBSD: ukbdmap.c,v 1.20.8.2 2010/11/21 02:38:07 riz Exp $	*/
 
 /*
  * Copyright (c) 1999,2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ukbdmap.c,v 1.20.8.1 2009/02/16 03:22:04 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ukbdmap.c,v 1.20.8.2 2010/11/21 02:38:07 riz Exp $);
 
 #include sys/types.h
 #include dev/wscons/wsksymdef.h
@@ -558,6 +558,44 @@
 KC(52),  KS_agrave,KS_adiaeresis,  KS_braceleft
 };
 
+static const keysym_t ukbd_keydesc_hu[] = {
+/*  pos  normal		shifted		altgr		shift-altgr */
+KC(5),   KS_b,		KS_B,		KS_braceleft,
+KC(6),   KS_c,		KS_C,		KS_ampersand,
+KC(9),   KS_f,		KS_F,		KS_bracketleft,
+KC(10),  KS_g,		KS_G,		KS_bracketright,
+KC(17),  KS_n,		KS_N,		KS_braceright,
+KC(20),  KS_q,		KS_Q,		KS_backslash,
+KC(25),  KS_v,		KS_V,		KS_at,
+KC(26),  KS_w,		KS_W,		KS_bar,
+KC(27),  KS_x,		KS_X,		KS_numbersign,
+KC(28),  KS_z,
+KC(29),  KS_y,		KS_Y,		KS_greater,
+KC(30),  KS_1,		KS_apostrophe,	KS_asciitilde,
+KC(31),  KS_2,		KS_quotedbl,	KS_dead_caron,
+KC(32),  KS_3,		KS_plus,	KS_asciicircum,
+KC(33),  KS_4,		KS_exclam,	KS_dead_breve,
+KC(34),  KS_5,		KS_percent,	KS_dead_abovering,
+KC(35),  KS_6,		KS_slash,	KS_dead_ogonek,
+KC(36),  KS_7,		KS_equal,	KS_grave,
+KC(37),  KS_8,		KS_parenleft,	KS_dead_dotaccent,
+KC(38),  KS_9,		KS_parenright,	KS_dead_acute,
+KC(39),  KS_odiaeresis,	KS_Odiaeresis,	KS_dead_hungarumlaut,
+KC(45),  KS_udiaeresis,	KS_Udiaeresis,	KS_dead_diaeresis,
+KC(46),  KS_oacute,		KS_Oacute,	KS_dead_cedilla,
+KC(47),  KS_odoubleacute,	KS_Odoubleacute,KS_division,
+KC(48),  KS_uacute,		KS_Uacute,	KS_multiply,
+KC(49),  KS_udoubleacute,	KS_Udoubleacute,KS_currency,
+KC(50),  KS_iacute,		KS_Iacute,	KS_less,
+KC(51),  KS_eacute,		KS_Eacute,	KS_dollar,
+KC(52),  KS_aacute,		KS_Aacute,	KS_ssharp,
+KC(53),  KS_0,		KS_section,
+KC(54),  KS_comma,		KS_question,	KS_semicolon,
+KC(55),  KS_period,		KS_colon,
+KC(56),  KS_minus,		KS_underscore,	KS_asterisk,
+KC(230), KS_Mode_switch,	KS_Multi_key
+};
+
 #define KBD_MAP(name, base, map) \
 			{ name, base, sizeof(map)/sizeof(keysym_t), map }
 
@@ -586,6 +624,7 @@
 	KBD_MAP(KB_SG | KB_NODEAD,	KB_SG,	ukbd_keydesc_sg_nodead),
 	KBD_MAP(KB_SF,			KB_SG,	ukbd_keydesc_sf),
 	KBD_MAP(KB_SF | KB_NODEAD,	KB_SF,	ukbd_keydesc_sg_nodead),
+	KBD_MAP(KB_HU,			KB_US,	ukbd_keydesc_hu),
 	{0, 0, 0, 0}
 };
 



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 19 23:45:11 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1358.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.11 -r1.963.4.12 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.11 -r1.962.4.12 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.11 src/sys/dev/pci/pcidevs.h:1.963.4.12
--- src/sys/dev/pci/pcidevs.h:1.963.4.11	Sun Mar 28 15:07:24 2010
+++ src/sys/dev/pci/pcidevs.h	Fri Nov 19 23:44:59 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.11 2010/03/28 15:07:24 snj Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.12 2010/11/19 23:44:59 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.11 2010/03/28 15:03:22 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.12 2010/11/19 23:40:28 riz Exp
  */
 
 /*
@@ -2224,6 +2224,7 @@
 #define	PCI_PRODUCT_INTEL_82801I_IFE_GT	0x10c3		/* 82801I (GT) LAN Controller */
 #define	PCI_PRODUCT_INTEL_82801H_IFE_GT	0x10c4		/* i82801H IFE (GT) LAN Controller */
 #define	PCI_PRODUCT_INTEL_82801H_IFE_G	0x10c5		/* i82801H IFE (G) LAN Controller */
+#define	PCI_PRODUCT_INTEL_82576_COPPER	0x10c9		/* 82576 1000BaseT Ethernet */
 #define	PCI_PRODUCT_INTEL_82801H_IGP_M_V	0x10cb		/* i82801H IGP (MV) LAN Controller */
 #define	PCI_PRODUCT_INTEL_82801J_R_BM_LM	0x10cc		/* i82567LM-2 LAN Controller */
 #define	PCI_PRODUCT_INTEL_82801J_R_BM_LF	0x10cd		/* i82567LF-2 LAN Controller */
@@ -2234,6 +2235,9 @@
 #define	PCI_PRODUCT_INTEL_82801J_D_BM_LF	0x10df		/* i82567LF-3 LAN Controller */
 #define	PCI_PRODUCT_INTEL_82575GB_QUAD_COPPER_PM	0x10e2		/* i82575GB Quad-1000baseT Ethernet (PM) */
 #define	PCI_PRODUCT_INTEL_82801I_BM	0x10e5		/* i82567LM-4 LAN Controller */
+#define	PCI_PRODUCT_INTEL_82576_FIBER	0x10e6		/* 82576 1000BaseX Ethernet */
+#define	PCI_PRODUCT_INTEL_82576_SERDES	0x10e7		/* 82576 gigabit Ethernet (SERDES) */
+#define	PCI_PRODUCT_INTEL_82576_QUAD_COPPER	0x10e8		/* 82576 quad-1000BaseT Ethernet */
 #define	PCI_PRODUCT_INTEL_PCH_M_LM	0x10ea		/* PCH LAN (82577LM) Controller */
 #define	PCI_PRODUCT_INTEL_PCH_M_LC	0x10eb		/* PCH LAN (82577LC) Controller */
 #define	PCI_PRODUCT_INTEL_PCH_D_DM	0x10ef		/* PCH LAN (82578DM) Controller */
@@ -2274,6 +2278,16 @@
 #define	PCI_PRODUCT_INTEL_82870P2_HPLUG	0x1462		/* 82870P2 P64H2 Hot Plug Controller */
 #define	PCI_PRODUCT_INTEL_82801I_82567V_3	0x1501		/* i82567V-3 LAN Controller */
 #define	PCI_PRODUCT_INTEL_82583V	0x150c		/* i82583V 1000baseT Ethernet */
+#define	PCI_PRODUCT_INTEL_82576_NS	0x150a		/* 82576 gigabit Ethernet */
+#define	PCI_PRODUCT_INTEL_82576_SERDES_QUAD	0x150d		/* 82576 quad-gigabit Ethernet (SERDES) */
+#define	PCI_PRODUCT_INTEL_82580_COPPER	0x150e		/* 82580 1000BaseT Ethernet */
+#define	PCI_PRODUCT_INTEL_82580_FIBER	0x150f		/* 82580 1000BaseX Ethernet */
+#define	PCI_PRODUCT_INTEL_82580_SERDES	0x1510		/* 82580 1000BaseT Ethernet (SERDES) */
+#define	PCI_PRODUCT_INTEL_82580_SGMII	0x1511		/* 82580 gigabit Ethernet (SGMII) */
+#define	PCI_PRODUCT_INTEL_82580_COPPER_DUAL	0x1516		/* 82580 dual-1000BaseT Ethernet */
+#define	PCI_PRODUCT_INTEL_82576_NS_SERDES	0x1518		/* 82576 gigabit Ethernet (SERDES) */
+#define	PCI_PRODUCT_INTEL_82580_ER	0x151d		/* 82580 1000BaseT Ethernet */
+#define	PCI_PRODUCT_INTEL_82580_ER_DUAL	0x151e		/* 82580 dual-1000BaseT Ethernet */
 #define	PCI_PRODUCT_INTEL_80960_RP	0x1960		/* ROB-in i960RP Microprocessor */
 #define	PCI_PRODUCT_INTEL_80960RM_2	0x1962		/* i960 RM PCI-PCI */
 #define	PCI_PRODUCT_INTEL_82840_HB	0x1a21		/* 82840 Host */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.11 src/sys/dev/pci/pcidevs_data.h:1.962.4.12
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.11	Sun Mar 28 15:07:24 2010
+++ src/sys/dev/pci/pcidevs_data.h	Fri Nov 19 23:44:59 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.11 2010/03/28 15:07:24 snj Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.12 2010/11/19 23:44:59 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.11 2010/03/28 15:03:22 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.12 2010/11/19 23:40:28 riz Exp
  */
 
 /*
@@ -7724,6 +7724,10 @@
 	i82801H IFE (G) LAN Controller,
 	},
 	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82576_COPPER,
+	82576 1000BaseT Ethernet,
+	},
+	{
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801H_IGP_M_V,
 	i82801H IGP (MV) LAN Controller,
 	},
@@ -7764,6 +7768,18 @@
 	i82567LM-4 LAN Controller,
 	},
 	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82576_FIBER,
+	82576 1000BaseX Ethernet,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82576_SERDES,
+	82576 gigabit Ethernet (SERDES),
+	},
+	{
+	

CVS commit: [netbsd-5] src/sys/dev/mii

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 19 23:59:22 UTC 2010

Modified Files:
src/sys/dev/mii [netbsd-5]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket 1359.


To generate a diff of this commit:
cvs rdiff -u -r1.81.4.3 -r1.81.4.4 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.71.4.3 -r1.71.4.4 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.81.4.3 src/sys/dev/mii/miidevs.h:1.81.4.4
--- src/sys/dev/mii/miidevs.h:1.81.4.3	Wed Jan 27 22:05:18 2010
+++ src/sys/dev/mii/miidevs.h	Fri Nov 19 23:59:22 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.81.4.3 2010/01/27 22:05:18 sborrill Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.81.4.4 2010/11/19 23:59:22 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.78.4.3 2010/01/27 22:03:18 sborrill Exp
+ *	NetBSD: miidevs,v 1.78.4.4 2010/11/19 23:58:41 riz Exp
  */
 
 /*-
@@ -172,6 +172,10 @@
 #define	MII_STR_BROADCOM_BCM5401	BCM5401 1000BASE-T media interface
 #define	MII_MODEL_BROADCOM_BCM5411	0x0007
 #define	MII_STR_BROADCOM_BCM5411	BCM5411 1000BASE-T media interface
+#define	MII_MODEL_BROADCOM_BCM5464	0x000b
+#define	MII_STR_BROADCOM_BCM5464	BCM5464 1000BASE-T media interface
+#define	MII_MODEL_BROADCOM_BCM5461	0x000c
+#define	MII_STR_BROADCOM_BCM5461	BCM5461 1000BASE-T media interface
 #define	MII_MODEL_BROADCOM_BCM5462	0x000d
 #define	MII_STR_BROADCOM_BCM5462	BCM5462 1000BASE-T media interface
 #define	MII_MODEL_BROADCOM_BCM5421	0x000e
@@ -206,8 +210,12 @@
 #define	MII_STR_BROADCOM2_BCM5709CAX	BCM5709CAX 10/100/1000baseT PHY
 #define	MII_MODEL_BROADCOM2_BCM5722	0x002d
 #define	MII_STR_BROADCOM2_BCM5722	BCM5722 1000BASE-T media interface
+#define	MII_MODEL_BROADCOM2_BCM5784	0x003a
+#define	MII_STR_BROADCOM2_BCM5784	BCM5784 10/100/1000baseT PHY
 #define	MII_MODEL_BROADCOM2_BCM5709C	0x003c
 #define	MII_STR_BROADCOM2_BCM5709C	BCM5709 10/100/1000baseT PHY
+#define	MII_MODEL_BROADCOM2_BCM5761	0x003d
+#define	MII_STR_BROADCOM2_BCM5761	BCM5761 10/100/1000baseT PHY
 #define	MII_MODEL_xxBROADCOM_ALT1_BCM5906	0x0004
 #define	MII_STR_xxBROADCOM_ALT1_BCM5906	BCM5906 10/100baseTX media interface
  

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.71.4.3 src/sys/dev/mii/miidevs_data.h:1.71.4.4
--- src/sys/dev/mii/miidevs_data.h:1.71.4.3	Wed Jan 27 22:05:19 2010
+++ src/sys/dev/mii/miidevs_data.h	Fri Nov 19 23:59:22 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.71.4.3 2010/01/27 22:05:19 sborrill Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.71.4.4 2010/11/19 23:59:22 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.78.4.3 2010/01/27 22:03:18 sborrill Exp
+ *	NetBSD: miidevs,v 1.78.4.4 2010/11/19 23:58:41 riz Exp
  */
 
 /*-
@@ -60,6 +60,8 @@
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5400, MII_STR_BROADCOM_BCM5400 },
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5401, MII_STR_BROADCOM_BCM5401 },
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5411, MII_STR_BROADCOM_BCM5411 },
+ { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5464, MII_STR_BROADCOM_BCM5464 },
+ { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5461, MII_STR_BROADCOM_BCM5461 },
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5462, MII_STR_BROADCOM_BCM5462 },
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5421, MII_STR_BROADCOM_BCM5421 },
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5752, MII_STR_BROADCOM_BCM5752 },
@@ -77,7 +79,9 @@
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5754, MII_STR_BROADCOM2_BCM5754 },
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5709CAX, MII_STR_BROADCOM2_BCM5709CAX },
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5722, MII_STR_BROADCOM2_BCM5722 },
+ { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5784, MII_STR_BROADCOM2_BCM5784 },
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5709C, MII_STR_BROADCOM2_BCM5709C },
+ { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5761, MII_STR_BROADCOM2_BCM5761 },
  { MII_OUI_xxBROADCOM_ALT1, MII_MODEL_xxBROADCOM_ALT1_BCM5906, MII_STR_xxBROADCOM_ALT1_BCM5906 },
  { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201, MII_STR_CICADA_CS8201 },
  { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201A, MII_STR_CICADA_CS8201A },



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 19 23:59:57 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket 1359.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.12 -r1.963.4.13 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.12 -r1.962.4.13 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.12 src/sys/dev/pci/pcidevs.h:1.963.4.13
--- src/sys/dev/pci/pcidevs.h:1.963.4.12	Fri Nov 19 23:44:59 2010
+++ src/sys/dev/pci/pcidevs.h	Fri Nov 19 23:59:46 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.12 2010/11/19 23:44:59 riz Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.13 2010/11/19 23:59:46 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.12 2010/11/19 23:40:28 riz Exp
+ *	NetBSD: pcidevs,v 1.962.4.13 2010/11/19 23:58:40 riz Exp
  */
 
 /*
@@ -1410,8 +1410,8 @@
 #define	PCI_PRODUCT_BLUESTEEL_5601	0x5601		/* 5601 */
 
 /* Broadcom products */
-#define	PCI_PRODUCT_BROADCOM_BCM5752	0x1600		/* BCM5752 10/100/1000 Ethernet */
-#define	PCI_PRODUCT_BROADCOM_BCM5752M	0x1601		/* BCM5752M 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5752	0x1600		/* BCM5752 NetXtreme 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5752M	0x1601		/* BCM5752M NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5709	0x1639		/* BCM5709 NetXtreme II 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5709S	0x163a		/* BCM5709 NetXtreme II 1000baseSX Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5716	0x163b		/* BCM5716 NetXtreme II 1000baseT Ethernet */
@@ -1427,9 +1427,13 @@
 #define	PCI_PRODUCT_BROADCOM_BCM5702FE	0x164d		/* BCM5702FE 10/100 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5705	0x1653		/* BCM5705 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5705K	0x1654		/* BCM5705K 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5717	0x1655		/* BCM5717 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5718	0x1656		/* BCM5718 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5720	0x1658		/* BCM5720 NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5721	0x1659		/* BCM5721 NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5722	0x165a		/* BCM5722 NetXtreme 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5723	0x165b		/* BCM5723 NetXtreme 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5724	0x165c		/* BCM5724 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5705M	0x165d		/* BCM5705M 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5705M_ALT	0x165e		/* BCM5705M 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5714	0x1668		/* BCM5714 1000baseT Ethernet */
@@ -1448,21 +1452,40 @@
 #define	PCI_PRODUCT_BROADCOM_BCM5755	0x167b		/* BCM5755 NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5750M	0x167c		/* BCM5750M 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5751M	0x167d		/* BCM5751M 10/100/1000 Ethernet */
-#define	PCI_PRODUCT_BROADCOM_BCM5751F	0x167e		/* BCM5751F 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5751F	0x167e		/* BCM5751F 10/100 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5787F	0x167f		/* BCM5787F 10/100 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5761E	0x1680		/* BCM5761E 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5761	0x1681		/* BCM5761 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5764	0x1684		/* BCM5764 NetXtreme 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5761S	0x1688		/* BCM5761S 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5761SE	0x1689		/* BCM5761SE 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57760	0x1690		/* BCM57760 NetXtreme 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57788	0x1691		/* BCM57788 NetLink 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57780	0x1692		/* BCM57780 NetXtreme 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5787M	0x1693		/* BCM5787M 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM57790	0x1694		/* BCM57790 10/100 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5782	0x1696		/* BCM5782 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5784M	0x1698		/* BCM5784M NetLink 1000baseT Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5785G	0x1699		/* BCM5785G 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5786	0x169a		/* BCM5786 NetLink 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5787	0x169b		/* BCM5787 NetLink 1000baseT Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5788	0x169c		/* BCM5788 10/100/1000 Ethernet */
-#define	PCI_PRODUCT_BROADCOM_BCM5789	0x169d		/* BCM5789 10/100/1000 Ethernet */
+#define	PCI_PRODUCT_BROADCOM_BCM5789	0x169d		/* BCM5789 NetLink 1000baseT Ethernet */

CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 00:18:59 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: agp_i810.c agp_intel.c pcidevs

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1362):
sys/dev/pci/pcidevs: revision 1.1026
sys/dev/pci/agp_intel.c: revision 1.35
sys/dev/pci/agp_i810.c: revision 1.67
Add Intel 82855GM Host-AGP Bridge.
regen
Add (non-IGP) AGP port support for Intel 82855GM.
agp_intel tested with radeondrm(4).  agp_i810 tested with i915drm(4).


To generate a diff of this commit:
cvs rdiff -u -r1.56.4.1 -r1.56.4.2 src/sys/dev/pci/agp_i810.c
cvs rdiff -u -r1.32 -r1.32.8.1 src/sys/dev/pci/agp_intel.c
cvs rdiff -u -r1.962.4.13 -r1.962.4.14 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/agp_i810.c
diff -u src/sys/dev/pci/agp_i810.c:1.56.4.1 src/sys/dev/pci/agp_i810.c:1.56.4.2
--- src/sys/dev/pci/agp_i810.c:1.56.4.1	Tue May  5 18:17:57 2009
+++ src/sys/dev/pci/agp_i810.c	Sat Nov 20 00:18:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp_i810.c,v 1.56.4.1 2009/05/05 18:17:57 bouyer Exp $	*/
+/*	$NetBSD: agp_i810.c,v 1.56.4.2 2010/11/20 00:18:59 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: agp_i810.c,v 1.56.4.1 2009/05/05 18:17:57 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: agp_i810.c,v 1.56.4.2 2010/11/20 00:18:59 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -241,6 +241,7 @@
 		case PCI_PRODUCT_INTEL_82865_HB:
 		case PCI_PRODUCT_INTEL_82845G_DRAM:
 		case PCI_PRODUCT_INTEL_82815_FULL_HUB:
+		case PCI_PRODUCT_INTEL_82855GM_MCH:
 			return agp_intel_attach(parent, self, aux);
 		}
 #endif

Index: src/sys/dev/pci/agp_intel.c
diff -u src/sys/dev/pci/agp_intel.c:1.32 src/sys/dev/pci/agp_intel.c:1.32.8.1
--- src/sys/dev/pci/agp_intel.c:1.32	Mon Jun  9 06:49:54 2008
+++ src/sys/dev/pci/agp_intel.c	Sat Nov 20 00:18:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp_intel.c,v 1.32 2008/06/09 06:49:54 freza Exp $	*/
+/*	$NetBSD: agp_intel.c,v 1.32.8.1 2010/11/20 00:18:59 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: agp_intel.c,v 1.32 2008/06/09 06:49:54 freza Exp $);
+__KERNEL_RCSID(0, $NetBSD: agp_intel.c,v 1.32.8.1 2010/11/20 00:18:59 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -90,6 +90,7 @@
 agp_intel_vgamatch(struct pci_attach_args *pa)
 {
 	switch (PCI_PRODUCT(pa-pa_id)) {
+	case PCI_PRODUCT_INTEL_82855GM_AGP:
 	case PCI_PRODUCT_INTEL_82855PM_AGP:
 	case PCI_PRODUCT_INTEL_82443LX_AGP:
 	case PCI_PRODUCT_INTEL_82443BX_AGP:
@@ -148,6 +149,7 @@
 	case PCI_PRODUCT_INTEL_82840_AGP:
 		isc-chiptype = CHIP_I840;
 		break;
+	case PCI_PRODUCT_INTEL_82855GM_AGP:
 	case PCI_PRODUCT_INTEL_82855PM_AGP:
 	case PCI_PRODUCT_INTEL_82845_AGP:
 		isc-chiptype = CHIP_I845;

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.962.4.13 src/sys/dev/pci/pcidevs:1.962.4.14
--- src/sys/dev/pci/pcidevs:1.962.4.13	Fri Nov 19 23:58:40 2010
+++ src/sys/dev/pci/pcidevs	Sat Nov 20 00:18:58 2010
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.13 2010/11/19 23:58:40 riz Exp $
+$NetBSD: pcidevs,v 1.962.4.14 2010/11/20 00:18:58 riz Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2636,6 +2636,7 @@
 product INTEL 82830MP_IV	0x3577	82830MP Integrated Video
 product INTEL 82830MP_IO_2	0x3578	82830MP CPU to I/O Bridge 2
 product INTEL 82855GM_MCH	0x3580	82855GM Host-Hub Controller
+product INTEL 82855GM_AGP	0x3581	82855GM Host-AGP Bridge
 product INTEL 82855GM_IGD	0x3582	82855GM GMCH Integrated Graphics Device
 product INTEL 82855GM_MC	0x3584	82855GM GMCH Memory Controller
 product INTEL 82855GM_CP	0x3585	82855GM GMCH Configuration Process



CVS commit: [netbsd-5] src/sys/dev/pci

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 00:19:48 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket 1362.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.13 -r1.963.4.14 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.13 -r1.962.4.14 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.13 src/sys/dev/pci/pcidevs.h:1.963.4.14
--- src/sys/dev/pci/pcidevs.h:1.963.4.13	Fri Nov 19 23:59:46 2010
+++ src/sys/dev/pci/pcidevs.h	Sat Nov 20 00:19:36 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.13 2010/11/19 23:59:46 riz Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.14 2010/11/20 00:19:36 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.13 2010/11/19 23:58:40 riz Exp
+ *	NetBSD
  */
 
 /*
@@ -2643,6 +2643,7 @@
 #define	PCI_PRODUCT_INTEL_82830MP_IV	0x3577		/* 82830MP Integrated Video */
 #define	PCI_PRODUCT_INTEL_82830MP_IO_2	0x3578		/* 82830MP CPU to I/O Bridge 2 */
 #define	PCI_PRODUCT_INTEL_82855GM_MCH	0x3580		/* 82855GM Host-Hub Controller */
+#define	PCI_PRODUCT_INTEL_82855GM_AGP	0x3581		/* 82855GM Host-AGP Bridge */
 #define	PCI_PRODUCT_INTEL_82855GM_IGD	0x3582		/* 82855GM GMCH Integrated Graphics Device */
 #define	PCI_PRODUCT_INTEL_82855GM_MC	0x3584		/* 82855GM GMCH Memory Controller */
 #define	PCI_PRODUCT_INTEL_82855GM_CP	0x3585		/* 82855GM GMCH Configuration Process */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.13 src/sys/dev/pci/pcidevs_data.h:1.962.4.14
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.13	Fri Nov 19 23:59:46 2010
+++ src/sys/dev/pci/pcidevs_data.h	Sat Nov 20 00:19:37 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.13 2010/11/19 23:59:46 riz Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.14 2010/11/20 00:19:37 riz Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.13 2010/11/19 23:58:40 riz Exp
+ *	NetBSD
  */
 
 /*
@@ -9400,6 +9400,10 @@
 	82855GM Host-Hub Controller,
 	},
 	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82855GM_AGP,
+	82855GM Host-AGP Bridge,
+	},
+	{
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82855GM_IGD,
 	82855GM GMCH Integrated Graphics Device,
 	},
@@ -14972,4 +14976,4 @@
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3142;
+const int pci_nproducts = 3143;



CVS commit: [netbsd-5] src/sys/dev/usb

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 01:15:07 UTC 2010

Modified Files:
src/sys/dev/usb [netbsd-5]: usbdevs.h usbdevs_data.h

Log Message:
Regen for ticket 1379.


To generate a diff of this commit:
cvs rdiff -u -r1.515.4.5 -r1.515.4.6 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.516.4.5 -r1.516.4.6 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.515.4.5 src/sys/dev/usb/usbdevs.h:1.515.4.6
--- src/sys/dev/usb/usbdevs.h:1.515.4.5	Tue Mar  9 03:46:24 2010
+++ src/sys/dev/usb/usbdevs.h	Sat Nov 20 01:15:06 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.515.4.5 2010/03/09 03:46:24 snj Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.515.4.6 2010/11/20 01:15:06 riz Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.519.4.5 2010/03/09 03:45:43 snj Exp
+ *	NetBSD
  */
 
 /*
@@ -421,6 +421,7 @@
 #define	USB_VENDOR_FALCOM	0x0f94		/* Falcom Wireless Communications GmbH */
 #define	USB_VENDOR_RIM	0x0fca		/* Research In Motion */
 #define	USB_VENDOR_DYNASTREAM	0x0fcf		/* Dynastream Innovations */
+#define	USB_VENDOR_SUNRISING	0x0fe6		/* SUNRISING */
 #define	USB_VENDOR_QUALCOMM	0x1004		/* Qualcomm */
 #define	USB_VENDOR_GIGABYTE	0x1044		/* GIGABYTE */
 #define	USB_VENDOR_MOTOROLA	0x1063		/* Motorola */
@@ -2202,6 +2203,9 @@
 /* XXX The above is a North American PC style keyboard possibly */
 #define	USB_PRODUCT_SUN_MOUSE	0x0100		/* Type 6 USB mouse */
 
+/* SUNRISING products */
+#define	USB_PRODUCT_SUNRISING_SR9600	0x8101		/* SR9600 Ethernet */
+
 /* SuperTop products */
 #define	USB_PRODUCT_SUPERTOP_IDEBRIDGE	0x6600		/* SuperTop IDE Bridge */
 

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.516.4.5 src/sys/dev/usb/usbdevs_data.h:1.516.4.6
--- src/sys/dev/usb/usbdevs_data.h:1.516.4.5	Tue Mar  9 03:46:24 2010
+++ src/sys/dev/usb/usbdevs_data.h	Sat Nov 20 01:15:07 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.516.4.5 2010/03/09 03:46:24 snj Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.516.4.6 2010/11/20 01:15:07 riz Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.519.4.5 2010/03/09 03:45:43 snj Exp
+ *	NetBSD
  */
 
 /*
@@ -1479,6 +1479,10 @@
 	Dynastream Innovations,
 	},
 	{
+	USB_VENDOR_SUNRISING,
+	SUNRISING,
+	},
+	{
 	USB_VENDOR_QUALCOMM,
 	Qualcomm,
 	},
@@ -1859,7 +1863,7 @@
 	GNU Radio USRP,
 	},
 };
-const int usb_nvendors = 455;
+const int usb_nvendors = 456;
 
 const struct usb_product usb_products[] = {
 	{
@@ -6363,6 +6367,10 @@
 	Type 6 USB mouse,
 	},
 	{
+	USB_VENDOR_SUNRISING, USB_PRODUCT_SUNRISING_SR9600,
+	SR9600 Ethernet,
+	},
+	{
 	USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDEBRIDGE,
 	SuperTop IDE Bridge,
 	},
@@ -6843,4 +6851,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1245;
+const int usb_nproducts = 1246;



CVS commit: [netbsd-5] src/sys/dev/pckbport

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 01:19:01 UTC 2010

Modified Files:
src/sys/dev/pckbport [netbsd-5]: synaptics.c synapticsreg.h

Log Message:
Pull up following revision(s) (requested by plunky in ticket #1383):
sys/dev/pckbport/synapticsreg.h: revision 1.6
sys/dev/pckbport/synaptics.c: revision 1.22
sys/dev/pckbport/synaptics.c: revision 1.23
sys/dev/pckbport/synaptics.c: revision 1.24
some definitions from the Linux driver (via PR kern/42853)
Extended capability probes can confuse the passthrough device,
reset the touchpad on enable to cure that.
send the SET_SCALE11 command before the 'sliced' command as per the
Linux driver (and elantech(4)), via PR kern/42853


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.10.1 src/sys/dev/pckbport/synaptics.c
cvs rdiff -u -r1.5 -r1.5.56.1 src/sys/dev/pckbport/synapticsreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.21 src/sys/dev/pckbport/synaptics.c:1.21.10.1
--- src/sys/dev/pckbport/synaptics.c:1.21	Wed Apr 30 14:07:14 2008
+++ src/sys/dev/pckbport/synaptics.c	Sat Nov 20 01:19:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.21 2008/04/30 14:07:14 ad Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.21.10.1 2010/11/20 01:19:01 riz Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include opt_pms.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.21 2008/04/30 14:07:14 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.21.10.1 2010/11/20 01:19:01 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -241,6 +241,10 @@
 		const char comma[] = , ;
 		const char *sep = ;
 		aprint_normal_dev(psc-sc_dev, );
+		if (sc-flags  SYN_FLAG_HAS_PASSTHROUGH) {
+			aprint_normal(%sPassthrough, sep);
+			sep = comma;
+		}
 		if (sc-flags  SYN_FLAG_HAS_MIDDLE_BUTTON) {
 			aprint_normal(%sMiddle button, sep);
 			sep = comma;
@@ -276,9 +280,19 @@
 {
 	struct pms_softc *psc = vsc;
 	struct synaptics_softc *sc = psc-u.synaptics;
-	u_char cmd[2];
+	u_char cmd[2], resp[2];
 	int res;
 
+	if (sc-flags  SYN_FLAG_HAS_PASSTHROUGH) {
+		/* 
+		 * Extended capability probes can confuse the passthrough device;
+		 * reset the touchpad now to cure that.
+		 */
+		cmd[0] = PMS_RESET;
+		res = pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, cmd,
+		1, 2, resp, 1);
+	}
+
 	/*
 	 * Enable Absolute mode with W (width) reporting, and set
 	 * the packet rate to maximum (80 packets per second).
@@ -286,7 +300,7 @@
 	res = pms_synaptics_send_command(psc-sc_kbctag, psc-sc_kbcslot,
 	SYNAPTICS_MODE_ABSOLUTE | SYNAPTICS_MODE_W | SYNAPTICS_MODE_RATE);
 	cmd[0] = PMS_SET_SAMPLE;
-	cmd[1] = 0x14; /* doit */
+	cmd[1] = SYNAPTICS_CMD_SET_MODE2;
 	res |= pckbport_enqueue_cmd(psc-sc_kbctag, psc-sc_kbcslot, cmd, 2, 0,
 	1, NULL);
 	sc-up_down = 0;
@@ -616,13 +630,16 @@
 	u_char cmd[2];
 	int res;
 
+	cmd[0] = PMS_SET_SCALE11;
+	res = pckbport_poll_cmd(tag, slot, cmd, 1, 0, NULL, 0);
+
 	/*
 	 * Need to send 4 Set Resolution commands, with the argument
 	 * encoded in the bottom most 2 bits.
 	 */
 	cmd[0] = PMS_SET_RES;
 	cmd[1] = syn_cmd  6;
-	res = pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0);
+	res |= pckbport_poll_cmd(tag, slot, cmd, 2, 0, NULL, 0);
 
 	cmd[0] = PMS_SET_RES;
 	cmd[1] = (syn_cmd  0x30)  4;

Index: src/sys/dev/pckbport/synapticsreg.h
diff -u src/sys/dev/pckbport/synapticsreg.h:1.5 src/sys/dev/pckbport/synapticsreg.h:1.5.56.1
--- src/sys/dev/pckbport/synapticsreg.h:1.5	Wed Jan 17 23:14:03 2007
+++ src/sys/dev/pckbport/synapticsreg.h	Sat Nov 20 01:19:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: synapticsreg.h,v 1.5 2007/01/17 23:14:03 uwe Exp $	*/
+/*	$NetBSD: synapticsreg.h,v 1.5.56.1 2010/11/20 01:19:01 riz Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -45,6 +45,10 @@
 #define SYNAPTICS_READ_MODEL_ID		0x3
 #define SYNAPTICS_EXTENDED_QUERY	0x9
 
+/* Synaptics special commands */
+#define SYNAPTICS_CMD_SET_MODE2		0x14
+#define SYNAPTICS_CMD_CLIENT_CMD	0x28
+
 /* Magic numbers. */
 #define SYNAPTICS_MIN_VERSION		45 /* 4.5 */
 #define SYNAPTICS_MAGIC_BYTE		0x47
@@ -64,6 +68,7 @@
 #define SYNAPTICS_MODE_RATE		(1  6)
 #define SYNAPTICS_MODE_SLEEP		(1  3)
 #define SYNAPTICS_MODE_GEST		(1  2)
+#define SYNAPTICS_MODE_4BYTE_CLIENT	(1  1)
 #define SYNAPTICS_MODE_W		(1)
 
 /* Extended mode button masks. */



  1   2   3   >