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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/pci

2010-03-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 28 15:07:31 UTC 2010

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

Log Message:
Regen for ticket 1326.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.10 -r1.963.4.11 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.10 -r1.962.4.11 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.10 src/sys/dev/pci/pcidevs.h:1.963.4.11
--- src/sys/dev/pci/pcidevs.h:1.963.4.10	Wed Jan 27 22:27:42 2010
+++ src/sys/dev/pci/pcidevs.h	Sun Mar 28 15:07:24 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.10 2010/01/27 22:27:42 sborrill Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.11 2010/03/28 15:07:24 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.9 2010/01/27 22:03:18 sborrill Exp
+ *	NetBSD: pcidevs,v 1.962.4.11 2010/03/28 15:03:22 snj Exp
  */
 
 /*
@@ -2974,6 +2974,10 @@
 #define	PCI_PRODUCT_SYMBIOS_SAS1066	0x005E		/* SAS1066 */
 #define	PCI_PRODUCT_SYMBIOS_SAS1078	0x0060		/* SAS1078 PCI */
 #define	PCI_PRODUCT_SYMBIOS_SAS1078_PCIE	0x0062		/* SAS1078 PCI Express */
+#define	PCI_PRODUCT_SYMBIOS_SAS2008	0x0072		/* SAS2008 */
+#define	PCI_PRODUCT_SYMBIOS_SAS2108_1	0x0078		/* MegaRAID SAS2108 CRYPTO GEN2 */
+#define	PCI_PRODUCT_SYMBIOS_SAS2108_2	0x0079		/* MegaRAID SAS2108 GEN2 */
+#define	PCI_PRODUCT_SYMBIOS_SAS1078DE	0x007c		/* SAS1078DE */
 #define	PCI_PRODUCT_SYMBIOS_875J	0x008f		/* 53c875J */
 #define	PCI_PRODUCT_SYMBIOS_FC909	0x0620		/* FC909 */
 #define	PCI_PRODUCT_SYMBIOS_FC909A	0x0621		/* FC909A */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.10 src/sys/dev/pci/pcidevs_data.h:1.962.4.11
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.10	Wed Jan 27 22:27:42 2010
+++ src/sys/dev/pci/pcidevs_data.h	Sun Mar 28 15:07:24 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.10 2010/01/27 22:27:42 sborrill Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.11 2010/03/28 15:07:24 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.9 2010/01/27 22:03:18 sborrill Exp
+ *	NetBSD: pcidevs,v 1.962.4.11 2010/03/28 15:03:22 snj Exp
  */
 
 /*
@@ -10412,6 +10412,22 @@
 	SAS1078 PCI Express,
 	},
 	{
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS2008,
+	SAS2008,
+	},
+	{
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS2108_1,
+	MegaRAID SAS2108 CRYPTO GEN2,
+	},
+	{
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS2108_2,
+	MegaRAID SAS2108 GEN2,
+	},
+	{
+	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_SAS1078DE,
+	SAS1078DE,
+	},
+	{
 	PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_875J,
 	53c875J,
 	},
@@ -14808,4 +14824,4 @@
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3101;
+const int pci_nproducts = 3105;



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

2010-01-23 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jan 23 17:50:43 UTC 2010

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

Log Message:
Pull up following revision(s) (requested by mbalmer in ticket #1254):
sys/dev/pci/pcidevs: revision 1.1015
sys/dev/pci/pcidevs.h: regen
sys/dev/pci/pcidevs_data.h: regen
Add two IBM RSS devices.


To generate a diff of this commit:
cvs rdiff -u -r1.962.4.7 -r1.962.4.8 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.7 src/sys/dev/pci/pcidevs:1.962.4.8
--- src/sys/dev/pci/pcidevs:1.962.4.7	Fri Dec 18 05:45:29 2009
+++ src/sys/dev/pci/pcidevs	Sat Jan 23 17:50:42 2010
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.7 2009/12/18 05:45:29 snj Exp $
+$NetBSD: pcidevs,v 1.962.4.8 2010/01/23 17:50:42 bouyer Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2063,6 +2063,8 @@
 product IBM GXT6500P	0x021b	GXT-6500P Graphics Adapter
 product IBM GXT4500P	0x021c	GXT-4500P Graphics Adapter
 product IBM GXT135P	0x0233	GXT-135P Graphics Adapter
+product IBM 4810_BSP	0x0295	4810 BSP
+product IBM 4810_SCC	0x0297	4810 SCC
 product IBM SERVERAID8K	0x9580	ServeRAID 8k
 product IBM MPIC2	0x	MPIC-II
 



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

2010-01-23 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jan 23 17:54:44 UTC 2010

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

Log Message:
Regen for ticket 1254


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.7 -r1.963.4.8 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.7 -r1.962.4.8 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.7 src/sys/dev/pci/pcidevs.h:1.963.4.8
--- src/sys/dev/pci/pcidevs.h:1.963.4.7	Fri Dec 18 05:46:41 2009
+++ src/sys/dev/pci/pcidevs.h	Sat Jan 23 17:54:38 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.7 2009/12/18 05:46:41 snj Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.8 2010/01/23 17:54:38 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.7 2009/12/18 05:45:29 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.8 2010/01/23 17:50:42 bouyer Exp
  */
 
 /*
@@ -2070,6 +2070,8 @@
 #define	PCI_PRODUCT_IBM_GXT6500P	0x021b		/* GXT-6500P Graphics Adapter */
 #define	PCI_PRODUCT_IBM_GXT4500P	0x021c		/* GXT-4500P Graphics Adapter */
 #define	PCI_PRODUCT_IBM_GXT135P	0x0233		/* GXT-135P Graphics Adapter */
+#define	PCI_PRODUCT_IBM_4810_BSP	0x0295		/* 4810 BSP */
+#define	PCI_PRODUCT_IBM_4810_SCC	0x0297		/* 4810 SCC */
 #define	PCI_PRODUCT_IBM_SERVERAID8K	0x9580		/* ServeRAID 8k */
 #define	PCI_PRODUCT_IBM_MPIC2	0x		/* MPIC-II */
 

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.7 src/sys/dev/pci/pcidevs_data.h:1.962.4.8
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.7	Fri Dec 18 05:46:41 2009
+++ src/sys/dev/pci/pcidevs_data.h	Sat Jan 23 17:54:38 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.7 2009/12/18 05:46:41 snj Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.8 2010/01/23 17:54:38 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.7 2009/12/18 05:45:29 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.8 2010/01/23 17:50:42 bouyer Exp
  */
 
 /*
@@ -7172,6 +7172,14 @@
 	GXT-135P Graphics Adapter,
 	},
 	{
+	PCI_VENDOR_IBM, PCI_PRODUCT_IBM_4810_BSP,
+	4810 BSP,
+	},
+	{
+	PCI_VENDOR_IBM, PCI_PRODUCT_IBM_4810_SCC,
+	4810 SCC,
+	},
+	{
 	PCI_VENDOR_IBM, PCI_PRODUCT_IBM_SERVERAID8K,
 	ServeRAID 8k,
 	},
@@ -14740,4 +14748,4 @@
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3084;
+const int pci_nproducts = 3086;



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

2010-01-23 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jan 23 17:56:17 UTC 2010

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

Log Message:
Pull up following revision(s) (requested by mbalmer in ticket #1255):
sys/dev/pci/pucdata.c: revision 1.59
Add the IBM 481033H SCC


To generate a diff of this commit:
cvs rdiff -u -r1.55.4.1 -r1.55.4.2 src/sys/dev/pci/pucdata.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/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.55.4.1 src/sys/dev/pci/pucdata.c:1.55.4.2
--- src/sys/dev/pci/pucdata.c:1.55.4.1	Fri Oct 16 06:32:37 2009
+++ src/sys/dev/pci/pucdata.c	Sat Jan 23 17:56:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.55.4.1 2009/10/16 06:32:37 snj Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.55.4.2 2010/01/23 17:56:17 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pucdata.c,v 1.55.4.1 2009/10/16 06:32:37 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: pucdata.c,v 1.55.4.2 2010/01/23 17:56:17 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -205,6 +205,17 @@
 	 * XXX Dolphin Peripherals 4078 (dual serial and single parallel)
 	 */
 
+	/* IBM SurePOS 300 Series (481033H) serial ports */
+	{   IBM SurePOS 300 Series (481033H),
+	{   PCI_VENDOR_IBM, PCI_PRODUCT_IBM_4810_SCC, 0, 0 },
+	{   0x, 0xfff,0, 0 },
+	{
+		{ PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ }, /* Port C */
+		{ PUC_PORT_TYPE_COM, 0x18, 0x00, COM_FREQ }, /* Port D */
+		{ PUC_PORT_TYPE_COM, 0x14, 0x00, COM_FREQ }, /* Port E */
+		{ PUC_PORT_TYPE_COM, 0x1c, 0x00, COM_FREQ }, /* Port F */
+	},
+	},
 
 	/*
 	 * SIIG Boards.



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

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:38:45 UTC 2010

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

Log Message:
Pull up following revision(s) (requested by tonnerre in ticket #1258):
sys/dev/pci/azalia.c: revision 1.72
sys/dev/pci/hdaudio/hdaudio_afg.c: revision 1.19
Signedness bug/crash in azalia and hdaudio. Fixes PR 42604.
By Pierre Pronchery.


To generate a diff of this commit:
cvs rdiff -u -r1.64.6.1 -r1.64.6.2 src/sys/dev/pci/azalia.c
cvs rdiff -u -r1.14.2.5 -r1.14.2.6 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/azalia.c
diff -u src/sys/dev/pci/azalia.c:1.64.6.1 src/sys/dev/pci/azalia.c:1.64.6.2
--- src/sys/dev/pci/azalia.c:1.64.6.1	Mon Mar  2 19:53:26 2009
+++ src/sys/dev/pci/azalia.c	Thu Jan 21 08:38:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: azalia.c,v 1.64.6.1 2009/03/02 19:53:26 snj Exp $	*/
+/*	$NetBSD: azalia.c,v 1.64.6.2 2010/01/21 08:38:45 snj Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: azalia.c,v 1.64.6.1 2009/03/02 19:53:26 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: azalia.c,v 1.64.6.2 2010/01/21 08:38:45 snj Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -2257,7 +2257,7 @@
 
 	az = v;
 	co = az-codecs[az-codecno];
-	if (mdev-index = co-nmixers)
+	if (mdev-index  0 || mdev-index = co-nmixers)
 		return ENXIO;
 	*mdev = co-mixers[mdev-index].devinfo;
 	return 0;

Index: src/sys/dev/pci/hdaudio/hdaudio_afg.c
diff -u src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.5 src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.6
--- src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.5	Sun Oct 18 16:50:13 2009
+++ src/sys/dev/pci/hdaudio/hdaudio_afg.c	Thu Jan 21 08:38:45 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_afg.c,v 1.14.2.5 2009/10/18 16:50:13 bouyer Exp $ */
+/* $NetBSD: hdaudio_afg.c,v 1.14.2.6 2010/01/21 08:38:45 snj 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.5 2009/10/18 16:50:13 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: hdaudio_afg.c,v 1.14.2.6 2010/01/21 08:38:45 snj Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -3500,7 +3500,7 @@
 	struct hdaudio_audiodev *ad = opaque;
 	struct hdaudio_afg_softc *sc = ad-ad_sc;
 
-	if (di-index = sc-sc_nmixers)
+	if (di-index  0 || di-index = sc-sc_nmixers)
 		return ENXIO;
 
 	*di = sc-sc_mixers[di-index].mx_di;



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

2010-01-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan  9 01:18:39 UTC 2010

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

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1210):
sys/dev/pci/viaide.c: revision 1.65
Don't forget to initialize data32iot and data32ioh in via_sata_chip_map_new().
This makes 32bit UDMA xfer work properly on VIA VT6421.


To generate a diff of this commit:
cvs rdiff -u -r1.57.4.1 -r1.57.4.2 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/viaide.c
diff -u src/sys/dev/pci/viaide.c:1.57.4.1 src/sys/dev/pci/viaide.c:1.57.4.2
--- src/sys/dev/pci/viaide.c:1.57.4.1	Sat Sep 26 19:04:21 2009
+++ src/sys/dev/pci/viaide.c	Sat Jan  9 01:18:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: viaide.c,v 1.57.4.1 2009/09/26 19:04:21 snj Exp $	*/
+/*	$NetBSD: viaide.c,v 1.57.4.2 2010/01/09 01:18:39 snj 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.1 2009/09/26 19:04:21 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: viaide.c,v 1.57.4.2 2010/01/09 01:18:39 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1082,6 +1082,8 @@
 			return;
 		}
 		wdc_init_shadow_regs(wdc_cp);
+		wdr-data32iot = wdr-cmd_iot;
+		wdr-data32ioh = wdr-cmd_iohs[wd_data];
 		wdcattach(wdc_cp);
 	}
 }



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

2010-01-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan  9 01:35:16 UTC 2010

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

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1218):
sys/dev/pci/auich.c: revision 1.133
Ensure that the memory or i/o space we need is accessible at attach
and resume.
Rework register mapping code path, using 'goto', so duplicate code
is reduced.
I've tested this on nvidia and sis auich(4)-compatible controllers.
In addition this change is reported to fix PR/39652.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.127.10.1 src/sys/dev/pci/auich.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/auich.c
diff -u src/sys/dev/pci/auich.c:1.127 src/sys/dev/pci/auich.c:1.127.10.1
--- src/sys/dev/pci/auich.c:1.127	Sun May  4 15:58:51 2008
+++ src/sys/dev/pci/auich.c	Sat Jan  9 01:35:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: auich.c,v 1.127 2008/05/04 15:58:51 xtraeme Exp $	*/
+/*	$NetBSD: auich.c,v 1.127.10.1 2010/01/09 01:35:16 snj Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: auich.c,v 1.127 2008/05/04 15:58:51 xtraeme Exp $);
+__KERNEL_RCSID(0, $NetBSD: auich.c,v 1.127.10.1 2010/01/09 01:35:16 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -209,8 +209,11 @@
 	int  sc_sts_reg;
 	/* 440MX workaround */
 	int  sc_dmamap_flags;
-	/* Native mode? */
-	int  sc_native_mode;
+	/* flags */
+	int  sc_iose	:1,
+	 sc_csr_io	:1,
+	 sc_csr_mem	:1,
+		 	:29;
 
 	/* sysctl */
 	struct sysctllog *sc_log;
@@ -476,46 +479,55 @@
 	if (d-id == PCIID_ICH4 || d-id == PCIID_ICH5 || d-id == PCIID_ICH6
 	|| d-id == PCIID_ICH7 || d-id == PCIID_I6300ESB
 	|| d-id == PCIID_ICH4MODEM) {
-		sc-sc_native_mode = 1;
 		/*
 		 * Use native mode for Intel 6300ESB and ICH4/ICH5/ICH6/ICH7
 		 */
+
+		sc-sc_csr_mem = 1;
+		v = pci_conf_read(pa-pa_pc, pa-pa_tag,
+		PCI_COMMAND_STATUS_REG);
+		pci_conf_write(pa-pa_pc, pa-pa_tag, PCI_COMMAND_STATUS_REG,
+			   v | PCI_COMMAND_MEM_ENABLE);
+		pa-pa_flags |= PCI_FLAGS_MEM_ENABLED;
+
 		if (pci_mapreg_map(pa, ICH_MMBAR, PCI_MAPREG_TYPE_MEM, 0,
-   sc-iot, sc-mix_ioh, NULL, sc-mix_size)) {
-			v = pci_conf_read(pa-pa_pc, pa-pa_tag, ICH_CFG);
-			pci_conf_write(pa-pa_pc, pa-pa_tag, ICH_CFG,
-   v | ICH_CFG_IOSE);
-			if (pci_mapreg_map(pa, ICH_NAMBAR, PCI_MAPREG_TYPE_IO,
-	   0, sc-iot, sc-mix_ioh, NULL,
-	   sc-mix_size)) {
-aprint_error_dev(self, can't map codec i/o space\n);
-return;
-			}
+		sc-iot, sc-mix_ioh, NULL, sc-mix_size)) {
+			goto retry_map;
 		}
 		if (pci_mapreg_map(pa, ICH_MBBAR, PCI_MAPREG_TYPE_MEM, 0,
-   sc-iot, sc-aud_ioh, NULL, sc-aud_size)) {
-			v = pci_conf_read(pa-pa_pc, pa-pa_tag, ICH_CFG);
-			pci_conf_write(pa-pa_pc, pa-pa_tag, ICH_CFG,
-   v | ICH_CFG_IOSE);
-			if (pci_mapreg_map(pa, ICH_NABMBAR, PCI_MAPREG_TYPE_IO,
-	   0, sc-iot, sc-aud_ioh, NULL,
-	   sc-aud_size)) {
-aprint_error_dev(self, can't map device i/o space\n);
-return;
-			}
-		}
-	} else {
-		if (pci_mapreg_map(pa, ICH_NAMBAR, PCI_MAPREG_TYPE_IO, 0,
-   sc-iot, sc-mix_ioh, NULL, sc-mix_size)) {
-			aprint_error_dev(self, can't map codec i/o space\n);
-			return;
-		}
-		if (pci_mapreg_map(pa, ICH_NABMBAR, PCI_MAPREG_TYPE_IO, 0,
-   sc-iot, sc-aud_ioh, NULL, sc-aud_size)) {
-			aprint_error_dev(self, can't map device i/o space\n);
-			return;
+		sc-iot, sc-aud_ioh, NULL, sc-aud_size)) {
+			goto retry_map;
 		}
+		goto map_done;
+	} else
+		goto non_native_map;
+
+retry_map:
+	sc-sc_iose = 1;
+	v = pci_conf_read(pa-pa_pc, pa-pa_tag, ICH_CFG);
+	pci_conf_write(pa-pa_pc, pa-pa_tag, ICH_CFG,
+		   v | ICH_CFG_IOSE);
+
+non_native_map:
+	sc-sc_csr_io = 1;
+	v = pci_conf_read(pa-pa_pc, pa-pa_tag,
+	PCI_COMMAND_STATUS_REG);
+	pci_conf_write(pa-pa_pc, pa-pa_tag, PCI_COMMAND_STATUS_REG,
+		   v | PCI_COMMAND_IO_ENABLE);
+	pa-pa_flags |= PCI_FLAGS_IO_ENABLED;
+
+	if (pci_mapreg_map(pa, ICH_NAMBAR, PCI_MAPREG_TYPE_IO, 0,
+			   sc-iot, sc-mix_ioh, NULL, sc-mix_size)) {
+		aprint_error_dev(self, can't map codec i/o space\n);
+		return;
 	}
+	if (pci_mapreg_map(pa, ICH_NABMBAR, PCI_MAPREG_TYPE_IO, 0,
+			   sc-iot, sc-aud_ioh, NULL, sc-aud_size)) {
+		aprint_error_dev(self, can't map device i/o space\n);
+		return;
+	}
+
+map_done:
 	sc-dmat = pa-pa_dmat;
 
 	/* enable bus mastering */
@@ -1576,12 +1588,19 @@
 	struct auich_softc *sc = device_private(dv);
 	pcireg_t v;
 
-	if (sc-sc_native_mode) {
+	if (sc-sc_iose) {
 		v = pci_conf_read(sc-sc_pc, sc-sc_pt, ICH_CFG);
 		pci_conf_write(sc-sc_pc, sc-sc_pt, ICH_CFG,
 			   v | ICH_CFG_IOSE);
 	}
 
+	v = pci_conf_read(sc-sc_pc, sc-sc_pt, PCI_COMMAND_STATUS_REG);
+	if (sc-sc_csr_io)
+		v |= PCI_COMMAND_IO_ENABLE;
+	if (sc-sc_csr_mem)
+		v |= 

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

2010-01-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan  9 01:56:51 UTC 2010

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

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1227):
sys/dev/pci/viaide.c: revision 1.66
enable mem space if it isn't already enabled.  several bioses leave
this not enabled, and viaide kind of depends upon it.
fixes viaide(4) on several machines.
idea from PR 38011, but reworked a little.


To generate a diff of this commit:
cvs rdiff -u -r1.57.4.2 -r1.57.4.3 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/viaide.c
diff -u src/sys/dev/pci/viaide.c:1.57.4.2 src/sys/dev/pci/viaide.c:1.57.4.3
--- src/sys/dev/pci/viaide.c:1.57.4.2	Sat Jan  9 01:18:39 2010
+++ src/sys/dev/pci/viaide.c	Sat Jan  9 01:56:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: viaide.c,v 1.57.4.2 2010/01/09 01:18:39 snj Exp $	*/
+/*	$NetBSD: viaide.c,v 1.57.4.3 2010/01/09 01:56:51 snj 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.2 2010/01/09 01:18:39 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: viaide.c,v 1.57.4.3 2010/01/09 01:56:51 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -853,6 +853,18 @@
 	pciide_mapreg_dma(sc, pa);
 	aprint_verbose(\n);
 
+	/*
+	 * Enable memory-space access if it isn't already there.
+	 */
+	if (pa-pa_memt  (pa-pa_flags  PCI_FLAGS_MEM_ENABLED) == 0) {
+		pcireg_t csr;
+
+		pa-pa_flags |= PCI_FLAGS_MEM_ENABLED;
+		csr = pci_conf_read(pa-pa_pc, pa-pa_tag, PCI_COMMAND_STATUS_REG);
+		pci_conf_write(pa-pa_pc, pa-pa_tag, PCI_COMMAND_STATUS_REG,
+		   csr | PCI_COMMAND_MEM_ENABLE);
+	}
+
 	if (sc-sc_dma_ok) {
 		sc-sc_wdcdev.sc_atac.atac_cap |= ATAC_CAP_UDMA | ATAC_CAP_DMA;
 		sc-sc_wdcdev.irqack = pciide_irqack;



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

2009-12-17 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Dec 18 05:45:29 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1175):
sys/dev/pci/pcidevs: revision 1.1003
Add Intel 3400 devices


To generate a diff of this commit:
cvs rdiff -u -r1.962.4.6 -r1.962.4.7 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.6 src/sys/dev/pci/pcidevs:1.962.4.7
--- src/sys/dev/pci/pcidevs:1.962.4.6	Wed Oct 28 09:03:42 2009
+++ src/sys/dev/pci/pcidevs	Fri Dec 18 05:45:29 2009
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.6 2009/10/28 09:03:42 bouyer Exp $
+$NetBSD: pcidevs,v 1.962.4.7 2009/12/18 05:45:29 snj Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2601,6 +2601,40 @@
 product INTEL ICH10_SATA2_2x2	0x3a26	ICH10 SATA2(2port2)
 product INTEL ICH10_SMB1	0x3a30	ICH10 SMBus Serial Bus 1
 product INTEL ICH10_SMB2	0x3a60	ICH10 SMBus Serial Bus 2
+product INTEL 3400_LPC		0x3b14	3400 LPC
+product INTEL 3400_SATA_1	0x3b20	3400 SATA
+product INTEL 3400_SATA_2	0x3b21	3400 SATA
+product INTEL 3400_AHCI_1	0x3b22	3400 AHCI
+product INTEL 3400_AHCI_2	0x3b23	3400 AHCI
+product INTEL 3400_RAID_1	0x3b25	3400 RAID
+product INTEL 3400_SATA_3	0x3b26	3400 SATA
+product INTEL 3400_SATA_4	0x3b28	3400 SATA
+product INTEL 3400_AHCI_3	0x3b29	3400 AHCI
+product INTEL 3400_RAID_2	0x3b2c	3400 RAID
+product INTEL 3400_SATA_5	0x3b2d	3400 SATA
+product INTEL 3400_SATA_6	0x3b2e	3400 SATA
+product INTEL 3400_AHCI_4	0x3b2f	3400 AHCI
+product INTEL 3400_SMB		0x3b30	3400 SMBus
+product INTEL 3400_THERMAL	0x3b32	3400 Thermal
+product INTEL 3400_EHCI_1	0x3b34	3400 USB
+product INTEL 3400_UHCI_1	0x3b36	3400 USB
+product INTEL 3400_UHCI_2	0x3b37	3400 USB
+product INTEL 3400_UHCI_3	0x3b38	3400 USB
+product INTEL 3400_UHCI_4	0x3b39	3400 USB
+product INTEL 3400_UHCI_5	0x3b3a	3400 USB
+product INTEL 3400_UHCI_6	0x3b3b	3400 USB
+product INTEL 3400_EHCI_2	0x3b3c	3400 USB
+product INTEL 3400_UHCI_7	0x3b3e	3400 USB
+product INTEL 3400_UHCI_8	0x3b3f	3400 USB
+product INTEL 3400_PCIE_1	0x3b42	3400 PCIE
+product INTEL 3400_PCIE_2	0x3b44	3400 PCIE
+product INTEL 3400_PCIE_3	0x3b46	3400 PCIE
+product INTEL 3400_PCIE_4	0x3b48	3400 PCIE
+product INTEL 3400_PCIE_5	0x3b4a	3400 PCIE
+product INTEL 3400_PCIE_6	0x3b4c	3400 PCIE
+product INTEL 3400_PCIE_7	0x3b4e	3400 PCIE
+product INTEL 3400_PCIE_8	0x3b50	3400 PCIE
+product INTEL 3400_HDA		0x3b56	3400 HD Audio
 product INTEL PRO_WL_2200BG	0x4220	PRO/Wireless LAN 2200BG Mini-PCI Adapter
 product INTEL PRO_WL_2225BG	0x4221	PRO/Wireless LAN 2225BG Mini-PCI Adapter
 product INTEL PRO_WL_3945ABG_1	0x4222	PRO/Wireless LAN 3945ABG Mini-PCI Adapter



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

2009-12-17 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Dec 18 05:46:45 UTC 2009

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

Log Message:
Regen for ticket 1175.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.6 -r1.963.4.7 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.6 -r1.962.4.7 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.6 src/sys/dev/pci/pcidevs.h:1.963.4.7
--- src/sys/dev/pci/pcidevs.h:1.963.4.6	Wed Oct 28 09:06:09 2009
+++ src/sys/dev/pci/pcidevs.h	Fri Dec 18 05:46:41 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.6 2009/10/28 09:06:09 bouyer Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.7 2009/12/18 05:46:41 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.6 2009/10/28 09:03:42 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.7 2009/12/18 05:45:29 snj Exp
  */
 
 /*
@@ -2608,6 +2608,40 @@
 #define	PCI_PRODUCT_INTEL_ICH10_SATA2_2x2	0x3a26		/* ICH10 SATA2(2port2) */
 #define	PCI_PRODUCT_INTEL_ICH10_SMB1	0x3a30		/* ICH10 SMBus Serial Bus 1 */
 #define	PCI_PRODUCT_INTEL_ICH10_SMB2	0x3a60		/* ICH10 SMBus Serial Bus 2 */
+#define	PCI_PRODUCT_INTEL_3400_LPC	0x3b14		/* 3400 LPC */
+#define	PCI_PRODUCT_INTEL_3400_SATA_1	0x3b20		/* 3400 SATA */
+#define	PCI_PRODUCT_INTEL_3400_SATA_2	0x3b21		/* 3400 SATA */
+#define	PCI_PRODUCT_INTEL_3400_AHCI_1	0x3b22		/* 3400 AHCI */
+#define	PCI_PRODUCT_INTEL_3400_AHCI_2	0x3b23		/* 3400 AHCI */
+#define	PCI_PRODUCT_INTEL_3400_RAID_1	0x3b25		/* 3400 RAID */
+#define	PCI_PRODUCT_INTEL_3400_SATA_3	0x3b26		/* 3400 SATA */
+#define	PCI_PRODUCT_INTEL_3400_SATA_4	0x3b28		/* 3400 SATA */
+#define	PCI_PRODUCT_INTEL_3400_AHCI_3	0x3b29		/* 3400 AHCI */
+#define	PCI_PRODUCT_INTEL_3400_RAID_2	0x3b2c		/* 3400 RAID */
+#define	PCI_PRODUCT_INTEL_3400_SATA_5	0x3b2d		/* 3400 SATA */
+#define	PCI_PRODUCT_INTEL_3400_SATA_6	0x3b2e		/* 3400 SATA */
+#define	PCI_PRODUCT_INTEL_3400_AHCI_4	0x3b2f		/* 3400 AHCI */
+#define	PCI_PRODUCT_INTEL_3400_SMB	0x3b30		/* 3400 SMBus */
+#define	PCI_PRODUCT_INTEL_3400_THERMAL	0x3b32		/* 3400 Thermal */
+#define	PCI_PRODUCT_INTEL_3400_EHCI_1	0x3b34		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_UHCI_1	0x3b36		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_UHCI_2	0x3b37		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_UHCI_3	0x3b38		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_UHCI_4	0x3b39		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_UHCI_5	0x3b3a		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_UHCI_6	0x3b3b		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_EHCI_2	0x3b3c		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_UHCI_7	0x3b3e		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_UHCI_8	0x3b3f		/* 3400 USB */
+#define	PCI_PRODUCT_INTEL_3400_PCIE_1	0x3b42		/* 3400 PCIE */
+#define	PCI_PRODUCT_INTEL_3400_PCIE_2	0x3b44		/* 3400 PCIE */
+#define	PCI_PRODUCT_INTEL_3400_PCIE_3	0x3b46		/* 3400 PCIE */
+#define	PCI_PRODUCT_INTEL_3400_PCIE_4	0x3b48		/* 3400 PCIE */
+#define	PCI_PRODUCT_INTEL_3400_PCIE_5	0x3b4a		/* 3400 PCIE */
+#define	PCI_PRODUCT_INTEL_3400_PCIE_6	0x3b4c		/* 3400 PCIE */
+#define	PCI_PRODUCT_INTEL_3400_PCIE_7	0x3b4e		/* 3400 PCIE */
+#define	PCI_PRODUCT_INTEL_3400_PCIE_8	0x3b50		/* 3400 PCIE */
+#define	PCI_PRODUCT_INTEL_3400_HDA	0x3b56		/* 3400 HD Audio */
 #define	PCI_PRODUCT_INTEL_PRO_WL_2200BG	0x4220		/* PRO/Wireless LAN 2200BG Mini-PCI Adapter */
 #define	PCI_PRODUCT_INTEL_PRO_WL_2225BG	0x4221		/* PRO/Wireless LAN 2225BG Mini-PCI Adapter */
 #define	PCI_PRODUCT_INTEL_PRO_WL_3945ABG_1	0x4222		/* PRO/Wireless LAN 3945ABG Mini-PCI Adapter */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.6 src/sys/dev/pci/pcidevs_data.h:1.962.4.7
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.6	Wed Oct 28 09:06:10 2009
+++ src/sys/dev/pci/pcidevs_data.h	Fri Dec 18 05:46:41 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.6 2009/10/28 09:06:10 bouyer Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.7 2009/12/18 05:46:41 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.6 2009/10/28 09:03:42 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.7 2009/12/18 05:45:29 snj Exp
  */
 
 /*
@@ -9260,6 +9260,142 @@
 	ICH10 SMBus Serial Bus 2,
 	},
 	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3400_LPC,
+	3400 LPC,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3400_SATA_1,
+	3400 SATA,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3400_SATA_2,
+	3400 SATA,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3400_AHCI_1,
+	3400 AHCI,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3400_AHCI_2,
+	3400 AHCI,
+	},
+	{
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3400_RAID_1,
+	3400 RAID,
+	},
+	{
+	PCI_VENDOR_INTEL, 

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

2009-12-17 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Dec 18 05:48:07 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1175):
sys/dev/pci/piixide.c: revision 1.52
Add support for Intel 3400 SATA


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.47.4.1 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/piixide.c
diff -u src/sys/dev/pci/piixide.c:1.47 src/sys/dev/pci/piixide.c:1.47.4.1
--- src/sys/dev/pci/piixide.c:1.47	Wed Oct  1 15:38:15 2008
+++ src/sys/dev/pci/piixide.c	Fri Dec 18 05:48:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: piixide.c,v 1.47 2008/10/01 15:38:15 christos Exp $	*/
+/*	$NetBSD: piixide.c,v 1.47.4.1 2009/12/18 05:48:07 snj 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 2008/10/01 15:38:15 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: piixide.c,v 1.47.4.1 2009/12/18 05:48:07 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -266,6 +266,48 @@
 	  Intel ICH10 Serial ATA 2 Controller 4x2,
 	  piixsata_chip_map,
 	},
+	{
+	  PCI_PRODUCT_INTEL_3400_SATA_1,
+	  0,
+	  Intel 3400 Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_3400_SATA_1,
+	  0,
+	  Intel 3400 Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_3400_SATA_2,
+	  0,
+	  Intel 3400 Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_3400_SATA_3,
+	  0,
+	  Intel 3400 Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_3400_SATA_4,
+	  0,
+	  Intel 3400 Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_3400_SATA_5,
+	  0,
+	  Intel 3400 Serial ATA Controller,
+	  piixsata_chip_map,
+	},
+	{
+	  PCI_PRODUCT_INTEL_3400_SATA_6,
+	  0,
+	  Intel 3400 Serial ATA Controller,
+	  piixsata_chip_map,
+	},
 	{ 0,
 	  0,
 	  NULL,



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

2009-11-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Nov  8 21:55:46 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by cegger in ticket #1124):
sys/dev/pci/if_age.c: revision 1.29
support flow control. from OpenBSD.
tested by hans@


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.2 -r1.28.2.3 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.2 src/sys/dev/pci/if_age.c:1.28.2.3
--- src/sys/dev/pci/if_age.c:1.28.2.2	Sun May  3 23:45:47 2009
+++ src/sys/dev/pci/if_age.c	Sun Nov  8 21:55:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.28.2.2 2009/05/03 23:45:47 snj Exp $ */
+/*	$NetBSD: if_age.c,v 1.28.2.3 2009/11/08 21:55:46 snj 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.2 2009/05/03 23:45:47 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_age.c,v 1.28.2.3 2009/11/08 21:55:46 snj Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -275,7 +275,7 @@
 	ifmedia_init(sc-sc_miibus.mii_media, 0, age_mediachange,
 	age_mediastatus);
 	mii_attach(self, sc-sc_miibus, 0x, MII_PHY_ANY,
-	   MII_OFFSET_ANY, 0);
+	   MII_OFFSET_ANY, MIIF_DOPAUSE);
 
 	if (LIST_FIRST(sc-sc_miibus.mii_phys) == NULL) {
 		aprint_error_dev(self, no PHY found!\n);
@@ -1166,12 +1166,10 @@
 	}
 	if ((IFM_OPTIONS(mii-mii_media_active)  IFM_FDX) != 0) {
 		reg |= MAC_CFG_FULL_DUPLEX;
-#ifdef notyet
 		if ((IFM_OPTIONS(mii-mii_media_active)  IFM_ETH_TXPAUSE) != 0)
 			reg |= MAC_CFG_TX_FC;
 		if ((IFM_OPTIONS(mii-mii_media_active)  IFM_ETH_RXPAUSE) != 0)
 			reg |= MAC_CFG_RX_FC;
-#endif
 	}
 
 	CSR_WRITE_4(sc, AGE_MAC_CFG, reg);



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

2009-11-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Nov  8 21:56:54 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by cegger in ticket #1124):
sys/dev/pci/if_agereg.h: revision 1.3
add TWSI registers. from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/dev/pci/if_agereg.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/if_agereg.h
diff -u src/sys/dev/pci/if_agereg.h:1.2.2.2 src/sys/dev/pci/if_agereg.h:1.2.2.3
--- src/sys/dev/pci/if_agereg.h:1.2.2.2	Sun May  3 23:45:47 2009
+++ src/sys/dev/pci/if_agereg.h	Sun Nov  8 21:56:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_agereg.h,v 1.2.2.2 2009/05/03 23:45:47 snj Exp $ */
+/*	$NetBSD: if_agereg.h,v 1.2.2.3 2009/11/08 21:56:54 snj Exp $ */
 /*	$OpenBSD: if_agereg.h,v 1.1 2009/01/16 05:00:34 kevlo Exp $	*/
 
 /*-
@@ -86,6 +86,9 @@
 #define	AGE_SPI_OP_READ			0x217	/* 8bits */
 
 #define	AGE_TWSI_CTRL			0x218
+#define	TWSI_CTRL_SW_LD_START		0x0800
+#define	TWSI_CTRL_HW_LD_START		0x1000
+#define	TWSI_CTRL_LD_EXIST		0x0040
 
 #define AGE_DEV_MISC_CTRL		0x21C
 



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

2009-11-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Nov  8 21:58:03 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by cegger in ticket #1124):
sys/dev/pci/if_age.c: revision 1.30
- Don't access VPD even if hardware advertised the capability.
  It seems that some revisions of the controllers hang while accessing
  the VPD. Because VPD access routine is now unused, nuke it.
- Let TWSI reload EEPROM if VPD capability is detected. Reloading
  the EEPROM will also set the Ethernet address, so age(4) now reads
  AGE_PAR0 and AGE_PAR1 register to get the Ethernet address. This removes
  removes a lot of hacks and enhance readability a lot.
- Double PHY reset timeout as it takes more time to take the PHY out of
  power-saving state.
- Explicitly check power-saving state by checking undocumented PHY
  registers. If link is not up, poke undocumented registers to take
  PHY out of power-saving state. This is the same thing done by the
  Linux driver.
- Don't rely on auto-clearing feature of master reset bit, just wait
  1ms and check idle status of MAC.
From FreeBSD via OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.3 -r1.28.2.4 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.3 src/sys/dev/pci/if_age.c:1.28.2.4
--- src/sys/dev/pci/if_age.c:1.28.2.3	Sun Nov  8 21:55:46 2009
+++ src/sys/dev/pci/if_age.c	Sun Nov  8 21:58:02 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.28.2.3 2009/11/08 21:55:46 snj Exp $ */
+/*	$NetBSD: if_age.c,v 1.28.2.4 2009/11/08 21:58:02 snj 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.3 2009/11/08 21:55:46 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_age.c,v 1.28.2.4 2009/11/08 21:58:02 snj Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -97,7 +97,6 @@
 static int	age_mediachange(struct ifnet *);
 
 static int	age_intr(void *);
-static int	age_read_vpd_word(struct age_softc *, uint32_t, uint32_t, uint32_t *);
 static int	age_dma_alloc(struct age_softc *);
 static void	age_dma_free(struct age_softc *);
 static void	age_get_macaddr(struct age_softc *, uint8_t[]);
@@ -558,37 +557,11 @@
 	return 1;
 }
 
-static int
-age_read_vpd_word(struct age_softc *sc, uint32_t vpdc, uint32_t offset,
-uint32_t *word)
-{
-	int i;
-	pcireg_t rv;
-
-	pci_conf_write(sc-sc_pct, sc-sc_pcitag, PCI_VPD_ADDRESS(vpdc),
-	offset  PCI_VPD_ADDRESS_SHIFT);
-	for (i = AGE_TIMEOUT; i  0; i--) {
-		DELAY(10);
-		rv = pci_conf_read(sc-sc_pct, sc-sc_pcitag,
-		PCI_VPD_ADDRESS(vpdc));
-		if ((rv  PCI_VPD_OPFLAG) == PCI_VPD_OPFLAG)
-			break;
-	}
-	if (i == 0) {
-		printf(%s: VPD read timeout!\n, device_xname(sc-sc_dev));
-		*word = 0;
-		return ETIMEDOUT;
-	}
-
-	*word = pci_conf_read(sc-sc_pct, sc-sc_pcitag, PCI_VPD_DATAREG(vpdc));
-	return 0;
-}
-
 static void
 age_get_macaddr(struct age_softc *sc, uint8_t eaddr[])
 {
-	uint32_t ea[2], off, reg, word;
-	int vpd_error, match, vpdc;
+	uint32_t ea[2], reg;
+	int i, vpdc;
 
 	reg = CSR_READ_4(sc, AGE_SPI_CTRL);
 	if ((reg  SPI_VPD_ENB) != 0) {
@@ -597,67 +570,22 @@
 		CSR_WRITE_4(sc, AGE_SPI_CTRL, reg);
 	}
 
-	vpd_error = 0;
-	ea[0] = ea[1] = 0;
-	if ((vpd_error = pci_get_capability(sc-sc_pct, sc-sc_pcitag,
-	PCI_CAP_VPD, vpdc, NULL))) {
+	if (pci_get_capability(sc-sc_pct, sc-sc_pcitag,
+	PCI_CAP_VPD, vpdc, NULL)) {
 		/*
-		 * PCI VPD capability exists, but it seems that it's
-		 * not in the standard form as stated in PCI VPD
-		 * specification such that driver could not use
-		 * pci_get_vpd_readonly(9) with keyword 'NA'.
-		 * Search VPD data starting at address 0x0100. The data
-		 * should be used as initializers to set AGE_PAR0,
-		 * AGE_PAR1 register including other PCI configuration
-		 * registers.
+		 * PCI VPD capability found, let TWSI reload EEPROM.
+		 * This will set Ethernet address of controller.
 		 */
-		word = 0;
-		match = 0;
-		reg = 0;
-		for (off = AGE_VPD_REG_CONF_START; off  AGE_VPD_REG_CONF_END;
-		off += sizeof(uint32_t)) {
-			vpd_error = age_read_vpd_word(sc, vpdc, off, word);
-			if (vpd_error != 0)
-break;
-			if (match != 0) {
-switch (reg) {
-case AGE_PAR0:
-	ea[0] = word;
-	break;
-case AGE_PAR1:
-	ea[1] = word;
-	break;
-default:
-	break;
-}
-match = 0;
-			} else if ((word  0xFF) == AGE_VPD_REG_CONF_SIG) {
-match = 1;
-reg = word  16;
-			} else
+		CSR_WRITE_4(sc, AGE_TWSI_CTRL, CSR_READ_4(sc, AGE_TWSI_CTRL) |
+		TWSI_CTRL_SW_LD_START);
+		for (i = 100; i  0; i++) {
+			DELAY(1000);
+			reg = CSR_READ_4(sc, AGE_TWSI_CTRL);
+			if ((reg  TWSI_CTRL_SW_LD_START) == 0)
 break;
 		}
-		

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

2009-11-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Nov  8 22:03:32 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by cegger in ticket #1124):
sys/dev/pci/if_age.c: revision 1.34
sys/dev/pci/if_ale.c: revision 1.9
Use m_pullup to handle defragmentation.
Reinject mbuf into TX queue when it couldn't be loaded.
diff for age(4) reviewed/discussed with plunky@ several weeks ago.


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.4 -r1.28.2.5 src/sys/dev/pci/if_age.c
cvs rdiff -u -r1.3.2.3 -r1.3.2.4 src/sys/dev/pci/if_ale.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.4 src/sys/dev/pci/if_age.c:1.28.2.5
--- src/sys/dev/pci/if_age.c:1.28.2.4	Sun Nov  8 21:58:02 2009
+++ src/sys/dev/pci/if_age.c	Sun Nov  8 22:03:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.28.2.4 2009/11/08 21:58:02 snj Exp $ */
+/*	$NetBSD: if_age.c,v 1.28.2.5 2009/11/08 22:03:32 snj 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.4 2009/11/08 21:58:02 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_age.c,v 1.28.2.5 2009/11/08 22:03:32 snj Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -1049,6 +1049,7 @@
 		if (age_encap(sc, m_head)) {
 			if (m_head == NULL)
 break;
+			IF_PREPEND(ifp-if_snd, m_head);
 			ifp-if_flags |= IFF_OACTIVE;
 			break;
 		}
@@ -1201,41 +1202,19 @@
 	if (error == EFBIG) {
 		error = 0;
 
-		MGETHDR(m, M_DONTWAIT, MT_DATA);
-		if (m == NULL) {
+		*m_head = m_pullup(*m_head, MHLEN);
+		if (*m_head == NULL) {
 			printf(%s: can't defrag TX mbuf\n, 
 			device_xname(sc-sc_dev));
-			m_freem(*m_head);
-			*m_head = NULL;
 			return ENOBUFS;
 		}
 
-		M_COPY_PKTHDR(m, *m_head);
-		if ((*m_head)-m_pkthdr.len  MHLEN) {
-			MCLGET(m, M_DONTWAIT);
-			if (!(m-m_flags  M_EXT)) {
-m_freem(*m_head);
-m_freem(m);
-*m_head = NULL;
-return ENOBUFS;
-			}
-		}
-		m_copydata(*m_head, 0, (*m_head)-m_pkthdr.len,
-		mtod(m, void *));
-		m_freem(*m_head);
-		m-m_len = m-m_pkthdr.len;
-		*m_head = m;
-
 		error = bus_dmamap_load_mbuf(sc-sc_dmat, map, *m_head,
 		  	BUS_DMA_NOWAIT);
 
 		if (error != 0) {
 			printf(%s: could not load defragged TX mbuf\n,
 			device_xname(sc-sc_dev));
-			if (!error) {
-bus_dmamap_unload(sc-sc_dmat, map);
-error = EFBIG;
-			}
 			m_freem(*m_head);
 			*m_head = NULL;
 			return error;

Index: src/sys/dev/pci/if_ale.c
diff -u src/sys/dev/pci/if_ale.c:1.3.2.3 src/sys/dev/pci/if_ale.c:1.3.2.4
--- src/sys/dev/pci/if_ale.c:1.3.2.3	Thu Sep 10 07:26:38 2009
+++ src/sys/dev/pci/if_ale.c	Sun Nov  8 22:03:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ale.c,v 1.3.2.3 2009/09/10 07:26:38 snj Exp $	*/
+/*	$NetBSD: if_ale.c,v 1.3.2.4 2009/11/08 22:03:32 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon yong...@freebsd.org
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ale.c,v 1.3.2.3 2009/09/10 07:26:38 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ale.c,v 1.3.2.4 2009/11/08 22:03:32 snj Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -933,41 +933,19 @@
 	if (error == EFBIG) {
 		error = 0;
 
-		MGETHDR(m, M_DONTWAIT, MT_DATA);
-		if (m == NULL) {
+		*m_head = m_pullup(*m_head, MHLEN);
+		if (*m_head == NULL) {
 			printf(%s: can't defrag TX mbuf\n,
 			device_xname(sc-sc_dev));
-			m_freem(*m_head);
-			*m_head = NULL;
 			return ENOBUFS;
 		}
 
-		M_COPY_PKTHDR(m, *m_head);
-		if ((*m_head)-m_pkthdr.len  MHLEN) {
-			MCLGET(m, M_DONTWAIT);
-			if (!(m-m_flags  M_EXT)) {
-m_freem(*m_head);
-m_freem(m);
-*m_head = NULL;
-return ENOBUFS;
-			}
-		}
-		m_copydata(*m_head, 0, (*m_head)-m_pkthdr.len,
-		mtod(m, void *));
-		m_freem(*m_head);
-		m-m_len = m-m_pkthdr.len;
-		*m_head = m;
-
 		error = bus_dmamap_load_mbuf(sc-sc_dmat, map, *m_head,
 		BUS_DMA_NOWAIT);
 
 		if (error != 0) {
 			printf(%s: could not load defragged TX mbuf\n,
 			device_xname(sc-sc_dev));
-			if (!error) {
-bus_dmamap_unload(sc-sc_dmat, map);
-error = EFBIG;
-			}
 			m_freem(*m_head);
 			*m_head = NULL;
 			return error;
@@ -1092,6 +1070,7 @@
 		if (ale_encap(sc, m_head)) {
 			if (m_head == NULL)
 break;
+			IF_PREPEND(ifp-if_snd, m_head);
 			ifp-if_flags |= IFF_OACTIVE;
 			break;
 		}



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

2009-10-31 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Sat Oct 31 13:45:27 UTC 2009

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

Log Message:
Pull up the following revisions(s) (requested by martin in ticket #1119):
sys/dev/pci/ifpci2.c:   revision 1.17

Fix endianess issues with ifritz(4) when accessing the B-channel fifos.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.14.1 src/sys/dev/pci/ifpci2.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/ifpci2.c
diff -u src/sys/dev/pci/ifpci2.c:1.13 src/sys/dev/pci/ifpci2.c:1.13.14.1
--- src/sys/dev/pci/ifpci2.c:1.13	Thu Apr 10 19:13:37 2008
+++ src/sys/dev/pci/ifpci2.c	Sat Oct 31 13:45:27 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ifpci2.c,v 1.13 2008/04/10 19:13:37 cegger Exp $	*/
+/* $NetBSD: ifpci2.c,v 1.13.14.1 2009/10/31 13:45:27 sborrill Exp $	*/
 /*
  *   Copyright (c) 1999 Gary Jennejohn. All rights reserved.
  *
@@ -36,14 +36,14 @@
  *	Fritz!Card PCI driver
  *	
  *
- *	$Id: ifpci2.c,v 1.13 2008/04/10 19:13:37 cegger Exp $
+ *	$Id: ifpci2.c,v 1.13.14.1 2009/10/31 13:45:27 sborrill Exp $
  *
  *  last edit-date: [Fri Jan  5 11:38:58 2001]
  *
  *---*/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ifpci2.c,v 1.13 2008/04/10 19:13:37 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ifpci2.c,v 1.13.14.1 2009/10/31 13:45:27 sborrill Exp $);
 
 
 #include sys/param.h
@@ -419,20 +419,19 @@
 static void
 hscx_read_fifo(int chan, void *buf, size_t len, struct isic_softc *sc)
 {
-	u_int32_t *ip;
-	size_t cnt;
-	int dataoff;
+	int dataoff;	
 
 	dataoff = chan ? HSCX_FIFO2 : HSCX_FIFO1;
-
-	ip = (u_int32_t *)buf;
-	cnt = 0;
-	/* what if len isn't a multiple of sizeof(int) and buf is */
-	/* too small  */
-	while (cnt  len)
-	{
-		*ip++ = bus_space_read_4(sc-sc_maps[0].t, sc-sc_maps[0].h, dataoff);
-		cnt += 4;
+	bus_space_read_multi_stream_4(sc-sc_maps[0].t, sc-sc_maps[0].h,
+	dataoff, buf, len/4);
+	if (__predict_false((len3)0)) {
+		uint32_t tmp;
+
+		buf = ((unsigned char*)buf) + (len  ~3u);
+		len = 3u;
+		tmp = bus_space_read_stream_4(sc-sc_maps[0].t,
+		sc-sc_maps[0].h, dataoff);
+		memcpy(buf, tmp, len);
 	}
 }
 
@@ -464,7 +463,6 @@
 static void
 hscx_write_fifo(int chan, const void *buf, size_t len, struct isic_softc *sc)
 {
-	const u_int32_t *ip;
 	size_t cnt;
 	int dataoff;
 	l1_bchan_state_t *Bchan = sc-sc_chan[chan];
@@ -485,13 +483,17 @@
 	AVMA1PPSETCMDLONG(cnt);
 	hscx_write_reg(chan, cnt, sc);
 
-	ip = (const u_int32_t *)buf;
-	cnt = 0;
-	while (cnt  len)
-	{
-		bus_space_write_4(sc-sc_maps[0].t, sc-sc_maps[0].h, dataoff, *ip);
-		ip++;
-		cnt += 4;
+	bus_space_write_multi_stream_4(sc-sc_maps[0].t, sc-sc_maps[0].h,
+	dataoff, buf, (len+3)/4);
+	if (__predict_false((len3)0)) {
+		uint32_t tmp;
+
+		buf = (const unsigned char*)buf + (len  ~3u);
+		len = 3u;
+		memset(tmp, 0, sizeof(tmp));
+		memcpy(tmp, buf, len);
+		bus_space_write_stream_4(sc-sc_maps[0].t, sc-sc_maps[0].h,
+		dataoff, tmp);
 	}
 }
 



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

2009-10-28 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 28 09:06:14 UTC 2009

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

Log Message:
Regen for ticket 1114


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.5 -r1.963.4.6 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.5 -r1.962.4.6 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.5 src/sys/dev/pci/pcidevs.h:1.963.4.6
--- src/sys/dev/pci/pcidevs.h:1.963.4.5	Sat Sep 26 20:06:46 2009
+++ src/sys/dev/pci/pcidevs.h	Wed Oct 28 09:06:09 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.5 2009/09/26 20:06:46 snj Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.6 2009/10/28 09:06:09 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.5 2009/09/26 20:05:43 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.6 2009/10/28 09:03:42 bouyer Exp
  */
 
 /*
@@ -1818,6 +1818,7 @@
 
 /* ENE Technology products */
 #define	PCI_PRODUCT_ENE_MCR510	0x0510		/* MCR510 PCI Memory Card Reader Controller */
+#define	PCI_PRODUCT_ENE_CB712	0x0550		/* CB712/714/810 PCI SD Card Reader Controller */
 #define	PCI_PRODUCT_ENE_CB1211	0x1211		/* CB1211 CardBus Controller */
 #define	PCI_PRODUCT_ENE_CB1225	0x1225		/* CB1225 CardBus Controller */
 #define	PCI_PRODUCT_ENE_CB1410	0x1410		/* CB1410 CardBus Controller */
@@ -3810,6 +3811,7 @@
 #define	PCI_PRODUCT_TI_PCI72111CB	0x8031		/* PCI7x21/7x11 Cardbus Controller */
 #define	PCI_PRODUCT_TI_PCI72111FW	0x8032		/* PCI7x21/7x11 IEEE 1394 Host Controller */
 #define	PCI_PRODUCT_TI_PCI72111FM	0x8033		/* PCI7x21/7x11 Integrated FlashMedia Controller */
+#define	PCI_PRODUCT_TI_PCI72111SD	0x8034		/* PCI7x21/7x11 SD Card Controller */
 #define	PCI_PRODUCT_TI_PCI6515A	0x8036		/* PCI6515A Cardbus Controller */
 #define	PCI_PRODUCT_TI_PCI6515ASM	0x8038		/* PCI6515A Cardbus Controller (Smart Card mode) */
 #define	PCI_PRODUCT_TI_ACX100A	0x8400		/* ACX100A 802.11b */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.5 src/sys/dev/pci/pcidevs_data.h:1.962.4.6
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.5	Sat Sep 26 20:06:47 2009
+++ src/sys/dev/pci/pcidevs_data.h	Wed Oct 28 09:06:10 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.5 2009/09/26 20:06:47 snj Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.6 2009/10/28 09:06:10 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.5 2009/09/26 20:05:43 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.6 2009/10/28 09:03:42 bouyer Exp
  */
 
 /*
@@ -6360,6 +6360,10 @@
 	MCR510 PCI Memory Card Reader Controller,
 	},
 	{
+	PCI_VENDOR_ENE, PCI_PRODUCT_ENE_CB712,
+	CB712/714/810 PCI SD Card Reader Controller,
+	},
+	{
 	PCI_VENDOR_ENE, PCI_PRODUCT_ENE_CB1211,
 	CB1211 CardBus Controller,
 	},
@@ -13232,6 +13236,10 @@
 	PCI7x21/7x11 Integrated FlashMedia Controller,
 	},
 	{
+	PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI72111SD,
+	PCI7x21/7x11 SD Card Controller,
+	},
+	{
 	PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI6515A,
 	PCI6515A Cardbus Controller,
 	},
@@ -14596,4 +14604,4 @@
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3048;
+const int pci_nproducts = 3050;



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

2009-10-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Oct 18 18:24:31 UTC 2009

Modified Files:
src/sys/dev/pci [netbsd-5]: Makefile
Added Files:
src/sys/dev/pci/hdaudio [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1101):
sys/dev/pci/Makefile: revision 1.13
sys/dev/pci/hdaudio/Makefile: revision 1.1
Install hdaudio includes required by userland tools


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.70.1 src/sys/dev/pci/Makefile
cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/pci/hdaudio/Makefile

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/Makefile
diff -u src/sys/dev/pci/Makefile:1.12 src/sys/dev/pci/Makefile:1.12.70.1
--- src/sys/dev/pci/Makefile:1.12	Sun Jul 23 12:01:26 2006
+++ src/sys/dev/pci/Makefile	Sun Oct 18 18:24:31 2009
@@ -1,7 +1,9 @@
-#	$NetBSD: Makefile,v 1.12 2006/07/23 12:01:26 bouyer Exp $
+#	$NetBSD: Makefile,v 1.12.70.1 2009/10/18 18:24:31 snj Exp $
 
 # use 'make -f Makefile.pcidevs' to make pcidevs.h and pcidevs_data.h
 
+SUBDIR=	hdaudio
+
 INCSDIR= /usr/include/dev/pci
 
 # Only install includes which are used by userland

Added files:

Index: src/sys/dev/pci/hdaudio/Makefile
diff -u /dev/null src/sys/dev/pci/hdaudio/Makefile:1.1.2.2
--- /dev/null	Sun Oct 18 18:24:31 2009
+++ src/sys/dev/pci/hdaudio/Makefile	Sun Oct 18 18:24:31 2009
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile,v 1.1.2.2 2009/10/18 18:24:31 snj Exp $
+
+INCSDIR= /usr/include/dev/pci/hdaudio
+
+# Only install includes which are used by userland
+INCS=	hdaudioio.h hdaudioreg.h
+
+.include bsd.kinc.mk



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

2009-10-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Oct 16 06:32:37 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1070):
sys/dev/pci/pucdata.c: revision 1.57
Add support for Oxford Semiconductor OXmPCI952 2 port UARTs.
Also update URL of Oxford UART chips.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.4.1 src/sys/dev/pci/pucdata.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/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.55 src/sys/dev/pci/pucdata.c:1.55.4.1
--- src/sys/dev/pci/pucdata.c:1.55	Sat Sep  6 22:36:40 2008
+++ src/sys/dev/pci/pucdata.c	Fri Oct 16 06:32:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.55 2008/09/06 22:36:40 rmind Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.55.4.1 2009/10/16 06:32:37 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pucdata.c,v 1.55 2008/09/06 22:36:40 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pucdata.c,v 1.55.4.1 2009/10/16 06:32:37 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -894,12 +894,22 @@
 	 * Boards with an Oxford Semiconductor chip.
 	 *
 	 * Oxford Semiconductor provides documentation for their chip at:
-	 * URL:http://www.oxsemi.com/products/uarts/index.html
+	 * URL:http://www.plxtech.com/products/uart
 	 *
 	 * As sold by Kouwell URL:http://www.kouwell.com/.
 	 * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports.
 	 */
 
+	/* Oxford Semiconductor OXmPCI952 PCI UARTs */
+	{   Oxford Semiconductor OXmPCI952 UARTs,
+	{	0x1415,	0x950a,	0,	0	},
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ * 10 },
+		{ PUC_PORT_TYPE_COM, 0x10, 0x08, COM_FREQ * 10 },
+	},
+	},
+
 	/* Oxford Semiconductor OX16PCI952 PCI `950 UARTs - 128 byte FIFOs */
 	{   Oxford Semiconductor OX16PCI952 UARTs,
 	{   0x1415, 0x9521, 0,	0	},



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

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct  3 21:53:01 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1022):
sys/dev/pci/if_vr.c: revision 1.98
Replace shutdownhook_establish(9) with pmf_device_register1(9).
Tested VIA VT86C100A (which is probed as VT3043).


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.95.4.1 src/sys/dev/pci/if_vr.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_vr.c
diff -u src/sys/dev/pci/if_vr.c:1.95 src/sys/dev/pci/if_vr.c:1.95.4.1
--- src/sys/dev/pci/if_vr.c:1.95	Wed Jul  9 16:14:57 2008
+++ src/sys/dev/pci/if_vr.c	Sat Oct  3 21:53:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vr.c,v 1.95 2008/07/09 16:14:57 joerg Exp $	*/
+/*	$NetBSD: if_vr.c,v 1.95.4.1 2009/10/03 21:53:01 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_vr.c,v 1.95 2008/07/09 16:14:57 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_vr.c,v 1.95.4.1 2009/10/03 21:53:01 snj Exp $);
 
 #include rnd.h
 
@@ -207,7 +207,6 @@
 struct vr_softc {
 	device_t		vr_dev;
 	void			*vr_ih;		/* interrupt cookie */
-	void			*vr_ats;	/* shutdown hook */
 	bus_space_tag_t		vr_bst;		/* bus space tag */
 	bus_space_handle_t	vr_bsh;		/* bus space handle */
 	bus_dma_tag_t		vr_dmat;	/* bus DMA tag */
@@ -1398,7 +1397,7 @@
 
 static int	vr_probe(device_t, struct cfdata *, void *);
 static void	vr_attach(device_t, device_t, void *);
-static void	vr_shutdown(void *);
+static bool	vr_shutdown(device_t, int);
 
 CFATTACH_DECL_NEW(vr, sizeof (struct vr_softc),
 vr_probe, vr_attach, NULL, NULL);
@@ -1431,12 +1430,14 @@
  * Stop all chip I/O so that the kernel's probe routines don't
  * get confused by errant DMAs when rebooting.
  */
-static void
-vr_shutdown(void *arg)
+static bool
+vr_shutdown(device_t self, int howto)
 {
-	struct vr_softc *sc = (struct vr_softc *)arg;
+	struct vr_softc *sc = device_private(self);
 
 	vr_stop(sc-vr_ec.ec_if, 1);
+
+	return true;
 }
 
 /*
@@ -1712,9 +1713,11 @@
 	RND_TYPE_NET, 0);
 #endif
 
-	sc-vr_ats = shutdownhook_establish(vr_shutdown, sc);
-	if (sc-vr_ats == NULL)
-		aprint_error_dev(self, warning: couldn't establish shutdown hook\n);
+	if (pmf_device_register1(self, NULL, NULL, vr_shutdown))
+		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, couldn't establish power handler\n);
+
 	return;
 
  fail_5:



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

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct  3 21:53:36 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1022):
sys/dev/pci/if_vr.c: revision 1.99
add suspend/resume support


To generate a diff of this commit:
cvs rdiff -u -r1.95.4.1 -r1.95.4.2 src/sys/dev/pci/if_vr.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_vr.c
diff -u src/sys/dev/pci/if_vr.c:1.95.4.1 src/sys/dev/pci/if_vr.c:1.95.4.2
--- src/sys/dev/pci/if_vr.c:1.95.4.1	Sat Oct  3 21:53:01 2009
+++ src/sys/dev/pci/if_vr.c	Sat Oct  3 21:53:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vr.c,v 1.95.4.1 2009/10/03 21:53:01 snj Exp $	*/
+/*	$NetBSD: if_vr.c,v 1.95.4.2 2009/10/03 21:53:36 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_vr.c,v 1.95.4.1 2009/10/03 21:53:01 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_vr.c,v 1.95.4.2 2009/10/03 21:53:36 snj Exp $);
 
 #include rnd.h
 
@@ -216,6 +216,7 @@
 	uint8_t 		vr_enaddr[ETHER_ADDR_LEN];
 	struct mii_data		vr_mii;		/* MII/media info */
 
+	pcireg_t		vr_id;		/* vendor/product ID */
 	uint8_t			vr_revid;	/* Rhine chip revision */
 
 	callout_t		vr_tick_ch;	/* tick callout */
@@ -324,6 +325,7 @@
 static void	vr_reset(struct vr_softc *);
 static int	vr_restore_state(pci_chipset_tag_t, pcitag_t, device_t,
 pcireg_t);
+static bool	vr_resume(device_t PMF_FN_PROTO);
 
 int	vr_copy_small = 0;
 
@@ -1462,6 +1464,7 @@
 	sc-vr_dev = self;
 	sc-vr_pc = pa-pa_pc;
 	sc-vr_tag = pa-pa_tag;
+	sc-vr_id = pa-pa_id;
 	callout_init(sc-vr_tick_ch, 0);
 
 	vrt = vr_lookup(pa);
@@ -1713,7 +1716,7 @@
 	RND_TYPE_NET, 0);
 #endif
 
-	if (pmf_device_register1(self, NULL, NULL, vr_shutdown))
+	if (pmf_device_register1(self, NULL, vr_resume, vr_shutdown))
 		pmf_class_network_register(self, ifp);
 	else
 		aprint_error_dev(self, couldn't establish power handler\n);
@@ -1762,3 +1765,14 @@
 	PCI_CONF_WRITE(PCI_INTERRUPT_REG, sc-vr_save_irq);
 	return 0;
 }
+
+static bool
+vr_resume(device_t self PMF_FN_ARGS)
+{
+	struct vr_softc *sc = device_private(self);
+
+	if (PCI_PRODUCT(sc-vr_id) != PCI_PRODUCT_VIATECH_VT3043)
+		VR_CLRBIT(sc, VR_STICKHW, (VR_STICKHW_DS0|VR_STICKHW_DS1));
+
+	return true;
+}



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

2009-09-29 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Sep 29 23:57:41 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1040):
sys/dev/pci/if_iwi.c: revision 1.79
make iwi_alloc_tx_ring() prototype match function declaration (shows up when
bus_addr_t != bus_size_t). Fix cast for 64bit paddr_t on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.74.2.3 -r1.74.2.4 src/sys/dev/pci/if_iwi.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_iwi.c
diff -u src/sys/dev/pci/if_iwi.c:1.74.2.3 src/sys/dev/pci/if_iwi.c:1.74.2.4
--- src/sys/dev/pci/if_iwi.c:1.74.2.3	Wed Jan 14 17:57:39 2009
+++ src/sys/dev/pci/if_iwi.c	Tue Sep 29 23:57:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwi.c,v 1.74.2.3 2009/01/14 17:57:39 snj Exp $  */
+/*	$NetBSD: if_iwi.c,v 1.74.2.4 2009/09/29 23:57:41 snj Exp $  */
 
 /*-
  * Copyright (c) 2004, 2005
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwi.c,v 1.74.2.3 2009/01/14 17:57:39 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwi.c,v 1.74.2.4 2009/09/29 23:57:41 snj Exp $);
 
 /*-
  * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -102,7 +102,7 @@
 static void	iwi_reset_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *);
 static void	iwi_free_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *);
 static int	iwi_alloc_tx_ring(struct iwi_softc *, struct iwi_tx_ring *,
-int, bus_addr_t, bus_size_t);
+int, bus_size_t, bus_size_t);
 static void	iwi_reset_tx_ring(struct iwi_softc *, struct iwi_tx_ring *);
 static void	iwi_free_tx_ring(struct iwi_softc *, struct iwi_tx_ring *);
 static struct mbuf *
@@ -2018,7 +2018,7 @@
 	int ntries, nsegs, error;
 	int sn;
 
-	nsegs = atop((char*)fw+size-1) - atop((char *)fw) + 1;
+	nsegs = atop((vaddr_t)fw+size-1) - atop((vaddr_t)fw) + 1;
 
 	/* Create a DMA map for the firmware image */
 	error = bus_dmamap_create(sc-sc_dmat, size, nsegs, size, 0,



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

2009-09-29 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Sep 30 00:00:50 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1040):
sys/dev/isa/if_lc_isa.c: revision 1.30
sys/dev/pci/pccbb.c: revision 1.183
Fix bus_addr_t/bus_size_t confusion


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.180.4.1 src/sys/dev/pci/pccbb.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/pccbb.c
diff -u src/sys/dev/pci/pccbb.c:1.180 src/sys/dev/pci/pccbb.c:1.180.4.1
--- src/sys/dev/pci/pccbb.c:1.180	Sat Oct 25 18:46:38 2008
+++ src/sys/dev/pci/pccbb.c	Wed Sep 30 00:00:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pccbb.c,v 1.180 2008/10/25 18:46:38 christos Exp $	*/
+/*	$NetBSD: pccbb.c,v 1.180.4.1 2009/09/30 00:00:49 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pccbb.c,v 1.180 2008/10/25 18:46:38 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: pccbb.c,v 1.180.4.1 2009/09/30 00:00:49 snj Exp $);
 
 /*
 #define CBB_DEBUG
@@ -150,7 +150,7 @@
 STATIC void pccbb_pcmcia_mem_free(pcmcia_chipset_handle_t,
 struct pcmcia_mem_handle *);
 STATIC int pccbb_pcmcia_mem_map(pcmcia_chipset_handle_t, int, bus_addr_t,
-bus_size_t, struct pcmcia_mem_handle *, bus_addr_t *, int *);
+bus_size_t, struct pcmcia_mem_handle *, bus_size_t *, int *);
 STATIC void pccbb_pcmcia_mem_unmap(pcmcia_chipset_handle_t, int);
 STATIC int pccbb_pcmcia_io_alloc(pcmcia_chipset_handle_t, bus_addr_t,
 bus_size_t, bus_size_t, struct pcmcia_io_handle *);
@@ -2683,7 +2683,7 @@
 STATIC int
 pccbb_pcmcia_mem_map(pcmcia_chipset_handle_t pch, int kind,
 bus_addr_t card_addr, bus_size_t size, struct pcmcia_mem_handle *pcmhp,
-bus_addr_t *offsetp, int *windowp)
+bus_size_t *offsetp, int *windowp)
 {
 	struct pccbb_softc *sc = (struct pccbb_softc *)pch;
 	struct pcic_handle *ph = sc-sc_pcmcia_h;



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

2009-09-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Sep 28 00:40:21 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1024):
sys/dev/pci/hdaudio/hdaudio_afg.c: revision 1.15
ensure that hp sensing is stopped on suspend, and restarted on resume if
required.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 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.2 src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.3
--- src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.2	Sat Sep 26 19:52:10 2009
+++ src/sys/dev/pci/hdaudio/hdaudio_afg.c	Mon Sep 28 00:40:21 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_afg.c,v 1.14.2.2 2009/09/26 19:52:10 snj Exp $ */
+/* $NetBSD: hdaudio_afg.c,v 1.14.2.3 2009/09/28 00:40:21 snj 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.2 2009/09/26 19:52:10 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: hdaudio_afg.c,v 1.14.2.3 2009/09/28 00:40:21 snj Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -106,7 +106,7 @@
 
 #define	HDAUDIO_UNSOLTAG_EVENT_HP	0x00
 
-#define	HDAUDIO_HP_SENSE_PERIOD		(hz / 2)
+#define	HDAUDIO_HP_SENSE_PERIOD		hz
 
 static const char *hdaudio_afg_mixer_names[] = HDAUDIO_DEVICE_NAMES;
 
@@ -290,6 +290,7 @@
 	audio_params_t			sc_pparam, sc_rparam;
 
 	struct callout			sc_jack_callout;
+	boolsc_jack_polling;
 
 	struct {
 		uint32_t		afg_cap;
@@ -308,6 +309,7 @@
 static void	hdaudio_afg_attach(device_t, device_t, void *);
 static int	hdaudio_afg_detach(device_t, int);
 static void	hdaudio_afg_childdet(device_t, device_t);
+static bool	hdaudio_afg_suspend(device_t PMF_FN_PROTO);
 static bool	hdaudio_afg_resume(device_t PMF_FN_PROTO);
 
 CFATTACH_DECL2_NEW(
@@ -2984,6 +2986,9 @@
 	uint32_t res = 0;
 	int i, j;
 
+	if (!device_is_active(sc-sc_dev))
+		goto resched;
+
 	for (i = 0; i  sc-sc_nassocs; i++)
 		for (j = 0; j  HDAUDIO_MAXPINS; j++) {
 			w = hdaudio_afg_widget_lookup(sc, as[i].as_pins[j]);
@@ -3030,6 +3035,7 @@
 			}
 		}
 
+resched:
 	callout_schedule(sc-sc_jack_callout, HDAUDIO_HP_SENSE_PERIOD);
 }
 
@@ -3070,8 +3076,8 @@
 		unsol : poll);
 	}
 	if (enable) {
+		sc-sc_jack_polling = true;
 		hdaudio_afg_hp_switch_handler(sc);
-		callout_schedule(sc-sc_jack_callout, HDAUDIO_HP_SENSE_PERIOD);
 	} else
 		hda_trace(sc, jack detect not enabled\n);
 }
@@ -3093,7 +3099,7 @@
 	callout_setfunc(sc-sc_jack_callout,
 	hdaudio_afg_hp_switch_handler, sc);
 
-	if (!pmf_device_register(self, NULL, hdaudio_afg_resume))
+	if (!pmf_device_register(self, hdaudio_afg_suspend, hdaudio_afg_resume))
 		aprint_error_dev(self, couldn't establish power handler\n);
 
 	sc-sc_config = prop_dictionary_get(args, pin-config);
@@ -3241,6 +3247,16 @@
 }
 
 static bool
+hdaudio_afg_suspend(device_t self PMF_FN_ARGS)
+{
+	struct hdaudio_afg_softc *sc = device_private(self);
+
+	callout_halt(sc-sc_jack_callout, NULL);
+
+	return true;
+}
+
+static bool
 hdaudio_afg_resume(device_t self PMF_FN_ARGS)
 {
 	struct hdaudio_afg_softc *sc = device_private(self);
@@ -3258,6 +3274,9 @@
 	hdaudio_afg_stream_connect(sc, AUMODE_PLAY);
 	hdaudio_afg_stream_connect(sc, AUMODE_RECORD);
 
+	if (sc-sc_jack_polling)
+		hdaudio_afg_hp_switch_handler(sc);
+
 	return true;
 }
 



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

2009-09-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 26 19:04:21 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1021):
sys/dev/pci/viaide.c: revision 1.60
Add PCI_PRODUCT_VIATECH_VT8237A_SATA_2 to list of product IDs.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.57.4.1 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/viaide.c
diff -u src/sys/dev/pci/viaide.c:1.57 src/sys/dev/pci/viaide.c:1.57.4.1
--- src/sys/dev/pci/viaide.c:1.57	Sat Sep  6 22:42:59 2008
+++ src/sys/dev/pci/viaide.c	Sat Sep 26 19:04:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: viaide.c,v 1.57 2008/09/06 22:42:59 rmind Exp $	*/
+/*	$NetBSD: viaide.c,v 1.57.4.1 2009/09/26 19:04:21 snj 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 2008/09/06 22:42:59 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: viaide.c,v 1.57.4.1 2009/09/26 19:04:21 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -329,6 +329,11 @@
 	  VIA Technologies VT8237A SATA Controller,
 	  via_sata_chip_map_7,
 	},
+	{ PCI_PRODUCT_VIATECH_VT8237A_SATA_2,
+	  0,
+	  VIA Technologies VT8237A (5337) SATA Controller,
+	  via_sata_chip_map_7,
+	},
 	{ PCI_PRODUCT_VIATECH_VT8237R_SATA,
 	  0,
 	  VIA Technologies VT8237R SATA Controller,



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

2009-09-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 26 20:05:43 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1021):
sys/dev/pci/pcidevs: revision 1.987
Add alternative product ID for VIA VT8237A Integrated SATA Controller


To generate a diff of this commit:
cvs rdiff -u -r1.962.4.4 -r1.962.4.5 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.4 src/sys/dev/pci/pcidevs:1.962.4.5
--- src/sys/dev/pci/pcidevs:1.962.4.4	Thu May 21 01:13:49 2009
+++ src/sys/dev/pci/pcidevs	Sat Sep 26 20:05:43 2009
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.4 2009/05/21 01:13:49 snj Exp $
+$NetBSD: pcidevs,v 1.962.4.5 2009/09/26 20:05:43 snj Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4024,6 +4024,7 @@
 product VIATECH KT880_4		0x4269	KT880 CPU to PCI Bridge
 product VIATECH VT3351_HB_4351	0x4351	VT3351 Host Bridge
 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 VT86C100A	0x6100	VT86C100A (Rhine-II) 10/100 Ethernet
 product VIATECH VT8378_IG	0x7205	VT8378 KM400 UniChrome Integrated Graphics



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

2009-09-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Sep 26 20:06:50 UTC 2009

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

Log Message:
Regen for ticket 1021.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.4 -r1.963.4.5 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.4 -r1.962.4.5 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.4 src/sys/dev/pci/pcidevs.h:1.963.4.5
--- src/sys/dev/pci/pcidevs.h:1.963.4.4	Thu May 21 01:14:44 2009
+++ src/sys/dev/pci/pcidevs.h	Sat Sep 26 20:06:46 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.4 2009/05/21 01:14:44 snj Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.5 2009/09/26 20:06:46 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.4 2009/05/21 01:13:49 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.5 2009/09/26 20:05:43 snj Exp
  */
 
 /*
@@ -4031,6 +4031,7 @@
 #define	PCI_PRODUCT_VIATECH_KT880_4	0x4269		/* KT880 CPU to PCI Bridge */
 #define	PCI_PRODUCT_VIATECH_VT3351_HB_4351	0x4351		/* VT3351 Host Bridge */
 #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_VT86C100A	0x6100		/* VT86C100A (Rhine-II) 10/100 Ethernet */
 #define	PCI_PRODUCT_VIATECH_VT8378_IG	0x7205		/* VT8378 KM400 UniChrome Integrated Graphics */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.4 src/sys/dev/pci/pcidevs_data.h:1.962.4.5
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.4	Thu May 21 01:14:44 2009
+++ src/sys/dev/pci/pcidevs_data.h	Sat Sep 26 20:06:47 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.4 2009/05/21 01:14:44 snj Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.5 2009/09/26 20:06:47 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.4 2009/05/21 01:13:49 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.5 2009/09/26 20:05:43 snj Exp
  */
 
 /*
@@ -14000,6 +14000,10 @@
 	CX700M2/VX700 IDE Controller,
 	},
 	{
+	PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8237A_SATA_2,
+	VT8237A Integrated SATA Controller,
+	},
+	{
 	PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT3351_IOAPIC,
 	VT3351 I/O APIC Interrupt Controller,
 	},
@@ -14592,4 +14596,4 @@
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3047;
+const int pci_nproducts = 3048;



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

2009-09-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Sep 15 06:40:52 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by mrg in ticket #952):
sys/dev/pci/pci_usrreq.c: revision 1.20 via patch
enable mmap() support for /dev/pci* with options PCI_ALLOW_MMAP


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.6.1 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 src/sys/dev/pci/pci_usrreq.c:1.16.6.1
--- src/sys/dev/pci/pci_usrreq.c:1.16	Wed Jun 11 19:27:03 2008
+++ src/sys/dev/pci/pci_usrreq.c	Tue Sep 15 06:40:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_usrreq.c,v 1.16 2008/06/11 19:27:03 cegger Exp $	*/
+/*	$NetBSD: pci_usrreq.c,v 1.16.6.1 2009/09/15 06:40:52 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_usrreq.c,v 1.16 2008/06/11 19:27:03 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_usrreq.c,v 1.16.6.1 2009/09/15 06:40:52 snj Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -55,6 +55,8 @@
 #include dev/pci/pcivar.h
 #include dev/pci/pciio.h
 
+#include opt_pci.h
+
 static int
 pciopen(dev_t dev, int flags, int mode, struct lwp *l)
 {
@@ -110,7 +112,7 @@
 static paddr_t
 pcimmap(dev_t dev, off_t offset, int prot)
 {
-#if 0
+#ifdef PCI_ALLOW_MMAP
 	struct pci_softc *sc = device_lookup_private(pci_cd, minor(dev));
 
 	/*
@@ -119,7 +121,26 @@
 	 * and pass 0 as the offset into that range.
 	 *
 	 * XXX Need a way to deal with linear/prefetchable/etc.
+	 *
+	 * XXX we rely on MD mmap() methods to enforce limits since these
+	 * are hidden in *_tag_t structs if they exist at all 
 	 */
+
+#ifdef PCI_MAGIC_IO_RANGE
+	/* 
+	 * first, check if someone's trying to map the IO range
+	 * XXX this assumes 64kB IO space even though some machines can have
+	 * significantly more than that - macppc's bandit host bridge allows
+	 * 8MB IO space and sparc64 may have the entire 4GB available. The
+	 * firmware on both tries to use the lower 64kB first though and
+	 * exausting it is pretty difficult so we should be safe
+	 */
+	if ((offset = PCI_MAGIC_IO_RANGE) 
+	(offset  (PCI_MAGIC_IO_RANGE + 0x1))) {
+		return bus_space_mmap(sc-sc_iot, offset - PCI_MAGIC_IO_RANGE,
+		0, prot, 0);
+	}
+#endif /* PCI_MAGIC_IO_RANGE */
 	return (bus_space_mmap(sc-sc_memt, offset, 0, prot, 0));
 #else
 	/* XXX Consider this further. */



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

2009-09-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Sep 15 06:48:49 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by mrg in ticket #952):
sys/dev/pci/pci_usrreq.c: revision 1.22 via patch
do as elad suggested and call kauth instead of using INSECURE in pcimmap()


To generate a diff of this commit:
cvs rdiff -u -r1.16.6.2 -r1.16.6.3 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.2 src/sys/dev/pci/pci_usrreq.c:1.16.6.3
--- src/sys/dev/pci/pci_usrreq.c:1.16.6.2	Tue Sep 15 06:45:32 2009
+++ src/sys/dev/pci/pci_usrreq.c	Tue Sep 15 06:48:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_usrreq.c,v 1.16.6.2 2009/09/15 06:45:32 snj Exp $	*/
+/*	$NetBSD: pci_usrreq.c,v 1.16.6.3 2009/09/15 06:48:49 snj 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.2 2009/09/15 06:45:32 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_usrreq.c,v 1.16.6.3 2009/09/15 06:48:49 snj Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -50,13 +50,13 @@
 #include sys/systm.h
 #include sys/errno.h
 #include sys/fcntl.h
+#include sys/kauth.h
 
 #include dev/pci/pcireg.h
 #include dev/pci/pcivar.h
 #include dev/pci/pciio.h
 
 #include opt_pci.h
-#include opt_insecure.h
 
 static int
 pciopen(dev_t dev, int flags, int mode, struct lwp *l)
@@ -113,9 +113,12 @@
 static paddr_t
 pcimmap(dev_t dev, off_t offset, int prot)
 {
-#ifdef INSECURE
 	struct pci_softc *sc = device_lookup_private(pci_cd, minor(dev));
 
+	if (kauth_authorize_generic(kauth_cred_get(), KAUTH_GENERIC_ISSUSER,
+	NULL) != 0) {
+		return -1;
+	}
 	/*
 	 * Since we allow mapping of the entire bus, we
 	 * take the offset to be the address on the bus,
@@ -143,9 +146,6 @@
 	}
 #endif /* PCI_MAGIC_IO_RANGE */
 	return (bus_space_mmap(sc-sc_memt, offset, 0, prot, 0));
-#else /* INSECURE */
-	return (-1);
-#endif /* INSECURE */
 }
 
 const struct cdevsw pci_cdevsw = {



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

2009-09-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Sep 10 07:26:38 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #941):
sys/dev/pci/if_ale.c: revision 1.4
sys/dev/pci/if_ale.c: revision 1.5
sys/dev/pci/if_ale.c: revision 1.6
sys/dev/pci/if_ale.c: revision 1.7
print chipset name. From OpenBSD.
support flow control. from OpenBSD.
tested by Kevin Lahey
don't read/write 1000baseT specific MII registers on 10/100M only device.
from OpenBSD.
fix multicast.


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/sys/dev/pci/if_ale.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_ale.c
diff -u src/sys/dev/pci/if_ale.c:1.3.2.2 src/sys/dev/pci/if_ale.c:1.3.2.3
--- src/sys/dev/pci/if_ale.c:1.3.2.2	Sun May  3 23:45:47 2009
+++ src/sys/dev/pci/if_ale.c	Thu Sep 10 07:26:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ale.c,v 1.3.2.2 2009/05/03 23:45:47 snj Exp $	*/
+/*	$NetBSD: if_ale.c,v 1.3.2.3 2009/09/10 07:26:38 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon yong...@freebsd.org
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ale.c,v 1.3.2.2 2009/05/03 23:45:47 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ale.c,v 1.3.2.3 2009/09/10 07:26:38 snj Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -142,6 +142,17 @@
 	if (phy != sc-ale_phyaddr)
 		return 0;
 
+	if (sc-ale_flags  ALE_FLAG_FASTETHER) {
+		switch (reg) {
+		case MII_100T2CR:
+		case MII_100T2SR:
+		case MII_EXTSR:
+			return 0;
+		default:
+			break;
+		}
+	}
+
 	CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ |
 	MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg));
 	for (i = ALE_PHY_TIMEOUT; i  0; i--) {
@@ -157,7 +168,7 @@
 		return 0;
 	}
 
-	return ((v  MDIO_DATA_MASK)  MDIO_DATA_SHIFT);
+	return (v  MDIO_DATA_MASK)  MDIO_DATA_SHIFT;
 }
 
 static void
@@ -170,6 +181,17 @@
 	if (phy != sc-ale_phyaddr)
 		return;
 
+	if (sc-ale_flags  ALE_FLAG_FASTETHER) {
+		switch (reg) {
+		case MII_100T2CR:
+		case MII_100T2SR:
+		case MII_EXTSR:
+			return;
+		default:
+			break;
+		}
+	}
+
 	CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE |
 	(val  MDIO_DATA_MASK)  MDIO_DATA_SHIFT |
 	MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg));
@@ -370,8 +392,9 @@
 	const char *intrstr;
 	struct ifnet *ifp;
 	pcireg_t memtype;
-	int error = 0;
+	int mii_flags, error = 0;
 	uint32_t rxf_len, txf_len;
+	const char *chipname;
 
 	aprint_naive(\n);
 	aprint_normal(: Attansic/Atheros L1E Ethernet\n);
@@ -418,7 +441,6 @@
 		aprint_error(\n);
 		goto fail;
 	}
-	aprint_normal_dev(self, %s\n, intrstr);
 
 	/* Set PHY address. */
 	sc-ale_phyaddr = ALE_PHY_ADDR;
@@ -434,15 +456,19 @@
 	if (sc-ale_rev = 0xF0) {
 		/* L2E Rev. B. AR8114 */
 		sc-ale_flags |= ALE_FLAG_FASTETHER;
+		chipname = AR8114 (L2E RevB);
 	} else {
 		if ((CSR_READ_4(sc, ALE_PHY_STATUS)  PHY_STATUS_100M) != 0) {
 			/* L1E AR8121 */
 			sc-ale_flags |= ALE_FLAG_JUMBO;
+			chipname = AR8121 (L1E);
 		} else {
 			/* L2E Rev. A. AR8113 */
 			sc-ale_flags |= ALE_FLAG_FASTETHER;
+			chipname = AR8113 (L2E RevA);
 		}
 	}
+	aprint_normal_dev(self, %s, %s\n, chipname, intrstr);
 
 	/*
 	 * All known controllers seems to require 4 bytes alignment
@@ -538,8 +564,11 @@
 	sc-sc_ec.ec_mii = sc-sc_miibus;
 	ifmedia_init(sc-sc_miibus.mii_media, 0, ale_mediachange,
 	ale_mediastatus);
+	mii_flags = 0;
+	if ((sc-ale_flags  ALE_FLAG_JUMBO) != 0)
+		mii_flags |= MIIF_DOPAUSE;
 	mii_attach(self, sc-sc_miibus, 0x, MII_PHY_ANY,
-	MII_OFFSET_ANY, 0);
+	MII_OFFSET_ANY, mii_flags);
 
 	if (LIST_FIRST(sc-sc_miibus.mii_phys) == NULL) {
 		aprint_error_dev(self, no PHY found!\n);
@@ -1151,12 +1180,10 @@
 	}
 	if ((IFM_OPTIONS(mii-mii_media_active)  IFM_FDX) != 0) {
 		reg |= MAC_CFG_FULL_DUPLEX;
-#ifdef notyet
 		if ((IFM_OPTIONS(mii-mii_media_active)  IFM_ETH_TXPAUSE) != 0)
 			reg |= MAC_CFG_TX_FC;
 		if ((IFM_OPTIONS(mii-mii_media_active)  IFM_ETH_RXPAUSE) != 0)
 			reg |= MAC_CFG_RX_FC;
-#endif
 	}
 	CSR_WRITE_4(sc, ALE_MAC_CFG, reg);
 }
@@ -1999,15 +2026,15 @@
 
 	rxcfg = CSR_READ_4(sc, ALE_MAC_CFG);
 	rxcfg = ~(MAC_CFG_ALLMULTI | MAC_CFG_BCAST | MAC_CFG_PROMISC);
+	ifp-if_flags = ~IFF_ALLMULTI;
 
 	/*
 	 * Always accept broadcast frames.
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp-if_flags  IFF_ALLMULTI || ifp-if_flags  IFF_PROMISC || 
-	ec-ec_multicnt  0) {
-allmulti:
+	if (ifp-if_flags  IFF_PROMISC || ec-ec_multicnt  0) {
+		ifp-if_flags |= IFF_ALLMULTI;
 		if (ifp-if_flags  IFF_PROMISC)
 			rxcfg |= MAC_CFG_PROMISC;
 		else
@@ -2019,13 +2046,7 @@
 
 		ETHER_FIRST_MULTI(step, ec, enm);
 		while (enm != NULL) {
-			if (memcmp(enm-enm_addrlo, enm-enm_addrhi,
-			ETHER_ADDR_LEN)) {
-				ifp-if_flags |= 

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

2009-08-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug  7 06:10:20 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #886):
sys/dev/pci/twa.c: revision 1.32
Disable completely bogus DIAGNOSTIC check.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.4.1 src/sys/dev/pci/twa.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/twa.c
diff -u src/sys/dev/pci/twa.c:1.28 src/sys/dev/pci/twa.c:1.28.4.1
--- src/sys/dev/pci/twa.c:1.28	Sun Jul 27 13:10:11 2008
+++ src/sys/dev/pci/twa.c	Fri Aug  7 06:10:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: twa.c,v 1.28 2008/07/27 13:10:11 joerg Exp $ */
+/*	$NetBSD: twa.c,v 1.28.4.1 2009/08/07 06:10:20 snj Exp $ */
 /*	$wasabi: twa.c,v 1.27 2006/07/28 18:17:21 wrstuden Exp $	*/
 
 /*-
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: twa.c,v 1.28 2008/07/27 13:10:11 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: twa.c,v 1.28.4.1 2009/08/07 06:10:20 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1300,7 +1300,7 @@
 }
 
 
-#ifdef		DIAGNOSTIC
+#if 0
 static void
 twa_check_response_q(struct twa_request *tr, int clear)
 {
@@ -1321,6 +1321,7 @@
 		req = tr;
 
 	if ((tr-tr_cmd_pkt_type  TWA_CMD_PKT_TYPE_EXTERNAL) != 0) {
+		XXX this is bogus ! req can't be anything else but tr !
 		if (req-tr_request_id == tr-tr_request_id) 
 			panic(req id: %d on controller queue twice,
 			tr-tr_request_id);
@@ -1353,7 +1354,7 @@
 		/* Response queue is not empty. */
 		rq.value = twa_inl(sc, TWA_RESPONSE_QUEUE_OFFSET);
 		tr = sc-sc_twa_request + rq.u.response_id;
-#ifdef		DIAGNOSTIC
+#if 0
 		twa_check_response_q(tr, 0);
 #endif
 		/* Unmap the command packet, and any associated data buffer. */
@@ -1367,7 +1368,7 @@
 	}
 	(void)twa_drain_pending_queue(sc);
 	
-#ifdef		DIAGNOSTIC	
+#if 0
 	twa_check_response_q(NULL, 1);
 #endif
 	return(rv);



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

2009-08-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug  4 19:57:25 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #870):
sys/dev/pci/if_bge.c: revision 1.167
Call prop_dictionary_set_uint32() before mii_attach() so that brgphy
can do prop_dictionary_get_uint32() correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.152.4.3 -r1.152.4.4 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.3 src/sys/dev/pci/if_bge.c:1.152.4.4
--- src/sys/dev/pci/if_bge.c:1.152.4.3	Tue Aug  4 19:46:20 2009
+++ src/sys/dev/pci/if_bge.c	Tue Aug  4 19:57:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.152.4.3 2009/08/04 19:46:20 snj Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.152.4.4 2009/08/04 19:57:24 snj 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.3 2009/08/04 19:46:20 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.152.4.4 2009/08/04 19:57:24 snj Exp $);
 
 #include bpfilter.h
 #include vlan.h
@@ -2559,6 +2559,10 @@
 		sc-bge_flags |= BGE_PHY_FIBER_TBI;
 	}
 
+	/* set phyflags before mii_attach() */
+	dict = device_properties(self);
+	prop_dictionary_set_uint32(dict, phyflags, sc-bge_flags);
+
 	if (sc-bge_flags  BGE_PHY_FIBER_TBI) {
 		ifmedia_init(sc-bge_ifmedia, IFM_IMASK, bge_ifmedia_upd,
 		bge_ifmedia_sts);
@@ -2647,9 +2651,6 @@
 		aprint_error_dev(self, couldn't establish power handler\n);
 	else
 		pmf_class_network_register(self, ifp);
-
-	dict = device_properties(self);
-	prop_dictionary_set_uint32(dict, phyflags, sc-bge_flags);
 }
 
 static void



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

2009-06-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Jun 17 20:33:39 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by cegger in ticket #814):
sys/dev/pci/ehci_pci.c: revision 1.45
Apply hw workaround required for all SB600 revisions and SB700 revisions
A12 and A13 to avoid USB subsystem hang symptom. The USB subsystem hang
symptom is observed when the system has multiple USB devices connected to it
or one USB device is often re-connected. In some cases a USB hub may be
required to observe this symptom.
This patch works around the problem by correcting the internal register setting
that will help by changing the behavior of the internal logic to avoid the
USB subsystem hang issue. The change in the behavior of the logic does not
impact the normal operation of the USB subsystem.
This fix has been discussed, developped, reviewed, polished up
and tested on current-users by several people. Thread starts at:
http://mail-index.netbsd.org/current-users/2009/05/17/msg009460.html


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.10.1 src/sys/dev/pci/ehci_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/ehci_pci.c
diff -u src/sys/dev/pci/ehci_pci.c:1.38 src/sys/dev/pci/ehci_pci.c:1.38.10.1
--- src/sys/dev/pci/ehci_pci.c:1.38	Mon Apr 28 20:23:54 2008
+++ src/sys/dev/pci/ehci_pci.c	Wed Jun 17 20:33:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.38 2008/04/28 20:23:54 martin Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.38.10.1 2009/06/17 20:33:39 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci_pci.c,v 1.38 2008/04/28 20:23:54 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci_pci.c,v 1.38.10.1 2009/06/17 20:33:39 bouyer Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -60,6 +60,18 @@
 #define DPRINTF(x)
 #endif
 
+enum ehci_pci_quirk_flags {
+	EHCI_PCI_QUIRK_AMD_SB600 = 0x1,	/* always need a quirk */
+	EHCI_PCI_QUIRK_AMD_SB700 = 0x2,	/* depends on the SMB revision */
+};
+
+static const struct pci_quirkdata ehci_pci_quirks[] = {
+	{ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB600_USB_EHCI,
+	EHCI_PCI_QUIRK_AMD_SB600 },
+	{ PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB700_USB_EHCI,
+	EHCI_PCI_QUIRK_AMD_SB700 },
+};
+
 static void ehci_release_ownership(ehci_softc_t *sc, pci_chipset_tag_t pc,
    pcitag_t tag);
 static void ehci_get_ownership(ehci_softc_t *sc, pci_chipset_tag_t pc,
@@ -74,7 +86,15 @@
 	void 			*sc_ih;		/* interrupt vectoring */
 };
 
+static int ehci_sb700_match(struct pci_attach_args *pa);
+static int ehci_apply_amd_quirks(struct ehci_pci_softc *sc);
+enum ehci_pci_quirk_flags ehci_pci_lookup_quirkdata(pci_vendor_id_t,
+	pci_product_id_t);
+
 #define EHCI_MAX_BIOS_WAIT		1000 /* ms */
+#define EHCI_SBx00_WORKAROUND_REG	0x50
+#define EHCI_SBx00_WORKAROUND_ENABLE	__BIT(27)
+
 
 static int
 ehci_pci_match(struct device *parent, struct cfdata *match,
@@ -106,6 +126,7 @@
 	usbd_status r;
 	int ncomp;
 	struct usb_pci *up;
+	int quirk;
 
 	sc-sc.sc_dev = self;
 	sc-sc.sc_bus.hci_private = sc;
@@ -116,6 +137,10 @@
 	aprint_normal(: %s (rev. 0x%02x)\n, devinfo,
 	PCI_REVISION(pa-pa_class));
 
+	/* Check for quirks */
+	quirk = ehci_pci_lookup_quirkdata(PCI_VENDOR(pa-pa_id),
+	   PCI_PRODUCT(pa-pa_id));
+
 	/* Map I/O registers */
 	if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
 			   sc-sc.iot, sc-sc.ioh, NULL, sc-sc.sc_size)) {
@@ -127,6 +152,17 @@
 	sc-sc_tag = tag;
 	sc-sc.sc_bus.dmatag = pa-pa_dmat;
 
+	/* Handle quirks */
+	switch (quirk) {
+	case EHCI_PCI_QUIRK_AMD_SB600:
+		ehci_apply_amd_quirks(sc);
+		break;
+	case EHCI_PCI_QUIRK_AMD_SB700:
+		if (pci_find_device(NULL, ehci_sb700_match))
+			ehci_apply_amd_quirks(sc);
+		break;
+	}
+
 	/* Enable the device. */
 	csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
 	pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
@@ -381,3 +417,47 @@
 	ehci_get_ownership(sc-sc, sc-sc_pc, sc-sc_tag);
 	return ehci_resume(dv PMF_FN_CALL);
 }
+
+static int
+ehci_sb700_match(struct pci_attach_args *pa)
+{
+	if (!(PCI_VENDOR(pa-pa_id) == PCI_VENDOR_ATI 
+	PCI_PRODUCT(pa-pa_id) == PCI_PRODUCT_ATI_SB600_SMB))
+		return 0;
+
+	switch (PCI_REVISION(pa-pa_class)) {
+	case 0x3a:
+	case 0x3b:
+		return 1;
+	}
+
+	return 0;
+}
+
+static int
+ehci_apply_amd_quirks(struct ehci_pci_softc *sc)
+{
+	pcireg_t value;
+ 
+	aprint_normal_dev(sc-sc.sc_dev,
+	applying AMD SB600/SB700 USB freeze workaround\n);
+	value = pci_conf_read(sc-sc_pc, sc-sc_tag, EHCI_SBx00_WORKAROUND_REG);
+	pci_conf_write(sc-sc_pc, sc-sc_tag, EHCI_SBx00_WORKAROUND_REG,
+	value | EHCI_SBx00_WORKAROUND_ENABLE);
+
+	return 0;
+}
+
+enum ehci_pci_quirk_flags
+ehci_pci_lookup_quirkdata(pci_vendor_id_t vendor, pci_product_id_t product)
+{
+	int i;
+
+	for (i = 0; i  

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

2009-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue May  5 18:21:43 UTC 2009

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

Log Message:
Regen for ticket 737


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.2 -r1.963.4.3 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.2 -r1.962.4.3 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.2 src/sys/dev/pci/pcidevs.h:1.963.4.3
--- src/sys/dev/pci/pcidevs.h:1.963.4.2	Sun May  3 23:16:22 2009
+++ src/sys/dev/pci/pcidevs.h	Tue May  5 18:21:41 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.2 2009/05/03 23:16:22 snj Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.3 2009/05/05 18:21:41 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962.4.2 2009/05/03 23:14:57 snj Exp
+ *	NetBSD: pcidevs,v 1.962.4.3 2009/05/05 18:17:57 bouyer Exp
  */
 
 /*
@@ -2501,12 +2501,16 @@
 #define	PCI_PRODUCT_INTEL_82801IH_LPC	0x2912		/* 82801IH LPC Interface Bridge */
 #define	PCI_PRODUCT_INTEL_82801IO_LPC	0x2914		/* 82801IO LPC Interface Bridge */
 #define	PCI_PRODUCT_INTEL_82801IR_LPC	0x2916		/* 82801IR LPC Interface Bridge */
+#define	PCI_PRODUCT_INTEL_82801IEM_LPC	0x2917		/* 82801IEM LPC Interface Bridge */
 #define	PCI_PRODUCT_INTEL_82801IB_LPC	0x2918		/* 82801IB LPC Interface Bridge */
+#define	PCI_PRODUCT_INTEL_82801IM_LPC	0x2919		/* 82801IM LPC Interface Bridge */
 #define	PCI_PRODUCT_INTEL_82801I_SATA_1	0x2920		/* 82801I SATA Controller with 4 ports */
 #define	PCI_PRODUCT_INTEL_82801I_SATA_2	0x2921		/* 82801I SATA Controller with 2 ports */
 #define	PCI_PRODUCT_INTEL_82801I_SATA_AHCI6	0x2922		/* 82801I AHCI SATA Controller with 6 ports */
 #define	PCI_PRODUCT_INTEL_82801I_SATA_AHCI4	0x2923		/* 82801I AHCI SATA Controller with 4 ports */
 #define	PCI_PRODUCT_INTEL_82801I_SATA_3	0x2926		/* 82801I SATA Controller with 2 ports */
+#define	PCI_PRODUCT_INTEL_82801I_SATA_4	0x2928		/* 82801I Mobile AHCI SATA Controller with 2 ports */
+#define	PCI_PRODUCT_INTEL_82801I_SATA_5	0x2929		/* 82801I Mobile AHCI SATA Controller with 4 ports */
 #define	PCI_PRODUCT_INTEL_82801I_SMB	0x2930		/* 82801I SMBus Controller */
 #define	PCI_PRODUCT_INTEL_82801I_THERMAL	0x2932		/* 82801I Thermal Controller */
 #define	PCI_PRODUCT_INTEL_82801I_USB_1	0x2934		/* 82801I USB UHCI Controller */
@@ -2527,6 +2531,9 @@
 #define	PCI_PRODUCT_INTEL_82801I_IGP_C	0x294c		/* 82801I (C) LAN Controller */
 #define	PCI_PRODUCT_INTEL_82946GZ_HB	0x2970		/* 82946GZ Host Bridge */
 #define	PCI_PRODUCT_INTEL_82946GZ_IGD	0x2972		/* 82946GZ Integrated Graphics Device */
+#define	PCI_PRODUCT_INTEL_82G35_HB	0x2980		/* 82G35 Host Bridge */
+#define	PCI_PRODUCT_INTEL_82G35_IGD	0x2982		/* 82G35 Integrated Graphics Device */
+#define	PCI_PRODUCT_INTEL_82G35_IGD_1	0x2983		/* 82G35 Integrated Graphics Device */
 #define	PCI_PRODUCT_INTEL_82965Q_HB	0x2990		/* 82965Q Host Bridge */
 #define	PCI_PRODUCT_INTEL_82965Q_EXP	0x2991		/* 82965Q PCI Express Bridge */
 #define	PCI_PRODUCT_INTEL_82965Q_IGD	0x2992		/* 82965Q Integrated Graphics Device */
@@ -2555,6 +2562,15 @@
 #define	PCI_PRODUCT_INTEL_82965PM_MEI	0x2a04		/* 82965PM MEI Controller */
 #define	PCI_PRODUCT_INTEL_82965PM_IDE	0x2a06		/* 82965PM IDE Interface */
 #define	PCI_PRODUCT_INTEL_82965PM_KT	0x2a07		/* 82965PM Serial Interface */
+#define	PCI_PRODUCT_INTEL_82GM45_HB	0x2a40		/* 82GM45 Host Bridge */
+#define	PCI_PRODUCT_INTEL_82GM45_IGD	0x2a42		/* 82GM45 Integrated Graphics Device */
+#define	PCI_PRODUCT_INTEL_82GM45_IGD_1	0x2a43		/* 82GM45 Integrated Graphics Device */
+#define	PCI_PRODUCT_INTEL_82IGD_E_HB	0x2e00		/* 82IGD_E Host Bridge */
+#define	PCI_PRODUCT_INTEL_82IGD_E_IGD	0x2e02		/* 82IGD_E Integrated Graphics */
+#define	PCI_PRODUCT_INTEL_82Q45_HB	0x2e10		/* 82Q45 Host Bridge */
+#define	PCI_PRODUCT_INTEL_82Q45_IGD	0x2e12		/* 82Q45 Integrated Graphics Device */
+#define	PCI_PRODUCT_INTEL_82G45_HB	0x2e20		/* 82G45 Host Bridge */
+#define	PCI_PRODUCT_INTEL_82G45_IGD	0x2e22		/* 82G45 Integrated Graphics Device */
 #define	PCI_PRODUCT_INTEL_31244	0x3200		/* 31244 Serial ATA Controller */
 #define	PCI_PRODUCT_INTEL_82855PM_DDR	0x3340		/* 82855PM MCH Host Controller */
 #define	PCI_PRODUCT_INTEL_82855PM_AGP	0x3341		/* 82855PM Host-AGP Bridge */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.2 src/sys/dev/pci/pcidevs_data.h:1.962.4.3
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.2	Sun May  3 23:16:22 2009
+++ src/sys/dev/pci/pcidevs_data.h	Tue May  5 18:21:41 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.2 2009/05/03 23:16:22 snj Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.3 2009/05/05 18:21:41 bouyer Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 

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

2009-05-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun May  3 17:51:03 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by spz in ticket #621):
sys/dev/pci/if_wm.c: revisions 1.168, 1.169 via patch
sys/dev/pci/if_wmreg.h: revision 1.26 via patch
On i82563, the em driver says that the ready bit in the MDIC register may be
incorrectly set. Insert delay(200) like the em driver.
--
Examine the management mode and mark DRV_LOAD (for ICH{8,9,10},80003,
8257{1,2,3,4}).
Add some error's printf().
Make the bank detect routine into the function.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.3 -r1.162.4.4 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.24 -r1.24.20.1 src/sys/dev/pci/if_wmreg.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/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.3 src/sys/dev/pci/if_wm.c:1.162.4.4
--- src/sys/dev/pci/if_wm.c:1.162.4.3	Fri Mar 20 13:01:35 2009
+++ src/sys/dev/pci/if_wm.c	Sun May  3 17:51:02 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.3 2009/03/20 13:01:35 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.4 2009/05/03 17:51:02 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.3 2009/03/20 13:01:35 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.4 2009/05/03 17:51:02 snj Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -581,11 +581,16 @@
 static int32_t	wm_read_ich8_data(struct wm_softc *, uint32_t,
 		 uint32_t, uint16_t *);
 static int32_t	wm_read_ich8_word(struct wm_softc *sc, uint32_t, uint16_t *);
+static void	wm_82547_txfifo_stall(void *);
+static int	wm_check_mng_mode(struct wm_softc *);
+static int	wm_check_mng_mode_ich8lan(struct wm_softc *);
+static int	wm_check_mng_mode_82574(struct wm_softc *);
+static int	wm_check_mng_mode_generic(struct wm_softc *);
+static void	wm_get_hw_control(struct wm_softc *);
 
 CFATTACH_DECL_NEW(wm, sizeof(struct wm_softc),
 wm_match, wm_attach, NULL, NULL);
 
-static void	wm_82547_txfifo_stall(void *);
 
 /*
  * Devices supported by this driver.
@@ -1266,6 +1271,17 @@
 	 */
 	wm_reset(sc);
 
+	switch (sc-sc_type) {
+	case WM_T_82573:
+	case WM_T_ICH8:
+	case WM_T_ICH9:
+		if (wm_check_mng_mode(sc) != 0)
+			wm_get_hw_control(sc);
+		break;
+	default:
+		break;
+	}
+
 	/*
 	 * Get some information about the EEPROM.
 	 */
@@ -1328,13 +1344,18 @@
 	 * that no EEPROM is attached.
 	 */
 
- 
 	/*
 	 * Validate the EEPROM checksum. If the checksum fails, flag this for
 	 * later, so we can fail future reads from the EEPROM.
 	 */
-	if (wm_validate_eeprom_checksum(sc))
-		sc-sc_flags |= WM_F_EEPROM_INVALID;
+	if (wm_validate_eeprom_checksum(sc)) {
+		/*
+		 * Read twice again because some PCI-e parts fail the first
+		 * check due to the link being in sleep state.
+		 */
+		if (wm_validate_eeprom_checksum(sc))
+			sc-sc_flags |= WM_F_EEPROM_INVALID;
+	}
 
 	if (sc-sc_flags  WM_F_EEPROM_INVALID)
 		aprint_verbose_dev(sc-sc_dev, No EEPROM\n);
@@ -3048,6 +3069,17 @@
 	/* Reset the chip to a known state. */
 	wm_reset(sc);
 
+	switch (sc-sc_type) {
+	case WM_T_82573:
+	case WM_T_ICH8:
+	case WM_T_ICH9:
+		if (wm_check_mng_mode(sc) != 0)
+			wm_get_hw_control(sc);
+		break;
+	default:
+		break;
+	}
+
 	/* Initialize the transmit descriptor ring. */
 	memset(sc-sc_txdescs, 0, WM_TXDESCSIZE(sc));
 	WM_CDTXSYNC(sc, 0, WM_NTXDESC(sc),
@@ -3463,8 +3495,11 @@
 		ret = wm_get_swsm_semaphore(sc);
 	}
 
-	if (ret)
+	if (ret) {
+		aprint_error_dev(sc-sc_dev, %s: failed to get semaphore\n,
+			__func__);
 		return 1;
+	}
 
 	if (sc-sc_flags  WM_F_EEPROM_HANDSHAKE)  {
 		reg = CSR_READ(sc, WMREG_EECD);
@@ -4260,14 +4295,20 @@
 	int func = 0; /* XXX gcc */
 
 	if ((sc-sc_type == WM_T_ICH8) || (sc-sc_type == WM_T_ICH9)) {
-		if (wm_get_swfwhw_semaphore(sc))
+		if (wm_get_swfwhw_semaphore(sc)) {
+			aprint_error_dev(sc-sc_dev,
+			%s: failed to get semaphore\n, __func__);
 			return;
+		}
 	}
 	if (sc-sc_type == WM_T_80003) {
 		func = (CSR_READ(sc, WMREG_STATUS)  STATUS_FUNCID_SHIFT)  1;
 		if (wm_get_swfw_semaphore(sc,
-		func ? SWFW_PHY1_SM : SWFW_PHY0_SM))
+			func ? SWFW_PHY1_SM : SWFW_PHY0_SM)) {
+			aprint_error_dev(sc-sc_dev,
+			%s: failed to get semaphore\n, __func__);
 			return;
+		}
 	}
 	if (sc-sc_type = WM_T_82544) {
 		CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl | CTRL_PHY_RESET);
@@ -4622,8 +4663,11 @@
 	if (phy != 1) /* only one PHY on kumeran bus */
 		return 0;
 
-	if (wm_get_swfw_semaphore(sc, func ? SWFW_PHY1_SM : SWFW_PHY0_SM))
+	if (wm_get_swfw_semaphore(sc, func ? SWFW_PHY1_SM : SWFW_PHY0_SM)) {
+		aprint_error_dev(sc-sc_dev, %s: failed to get semaphore\n,
+		__func__);
 		return 0;
+	}
 
 	if ((reg  GG82563_MAX_REG_ADDRESS)  GG82563_MIN_ALT_REG) {
 		

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

2009-05-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun May  3 17:54:08 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by tls in ticket #627):
sys/dev/pci/if_wm.c: revision 1.171
Enable the vlan code that thor...@netbsd.org added, and fix a bug where
the vlan tag was read from the rx descriptor after it was reinitialized
(and hence was always 0).  Hardware vlan support looks good tested
between two vmware clients.
With support from t...@netbsd.org.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.4 -r1.162.4.5 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.4 src/sys/dev/pci/if_wm.c:1.162.4.5
--- src/sys/dev/pci/if_wm.c:1.162.4.4	Sun May  3 17:51:02 2009
+++ src/sys/dev/pci/if_wm.c	Sun May  3 17:54:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.4 2009/05/03 17:51:02 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.5 2009/05/03 17:54:07 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.4 2009/05/03 17:51:02 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.5 2009/05/03 17:54:07 snj Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -1998,9 +1998,7 @@
 {
 	struct wm_softc *sc = ifp-if_softc;
 	struct mbuf *m0;
-#if 0 /* XXXJRT */
 	struct m_tag *mtag;
-#endif
 	struct wm_txsoft *txs;
 	bus_dmamap_t dmamap;
 	int error, nexttx, lasttx = -1, ofree, seg, segs_needed, use_tso;
@@ -2241,7 +2239,6 @@
 		sc-sc_txdescs[lasttx].wtx_cmdlen |=
 		htole32(WTX_CMD_EOP | WTX_CMD_RS);
 
-#if 0 /* XXXJRT */
 		/*
 		 * If VLANs are enabled and the packet has a VLAN tag, set
 		 * up the descriptor to encapsulate the packet for us.
@@ -2254,7 +2251,6 @@
 			sc-sc_txdescs[lasttx].wtx_fields.wtxu_vlan
 			= htole16(VLAN_TAG_VALUE(mtag)  0x);
 		}
-#endif /* XXXJRT */
 
 		txs-txs_lastdesc = lasttx;
 
@@ -2558,6 +2554,7 @@
 	struct mbuf *m;
 	int i, len;
 	uint8_t status, errors;
+	uint16_t vlantag;
 
 	for (i = sc-sc_rxptr;; i = WM_NEXTRX(i)) {
 		rxs = sc-sc_rxsoft[i];
@@ -2571,6 +2568,7 @@
 		status = sc-sc_rxdescs[i].wrx_status;
 		errors = sc-sc_rxdescs[i].wrx_errors;
 		len = le16toh(sc-sc_rxdescs[i].wrx_len);
+		vlantag = sc-sc_rxdescs[i].wrx_special;
 
 		if ((status  WRX_ST_DD) == 0) {
 			/*
@@ -2695,17 +2693,15 @@
 		m-m_pkthdr.rcvif = ifp;
 		m-m_pkthdr.len = len;
 
-#if 0 /* XXXJRT */
 		/*
 		 * If VLANs are enabled, VLAN packets have been unwrapped
 		 * for us.  Associate the tag with the packet.
 		 */
 		if ((status  WRX_ST_VP) != 0) {
 			VLAN_INPUT_TAG(ifp, m,
-			le16toh(sc-sc_rxdescs[i].wrx_special,
+			le16toh(vlantag),
 			continue);
 		}
-#endif /* XXXJRT */
 
 		/*
 		 * Set up checksum info for this packet.
@@ -3194,12 +3190,10 @@
 	}
 	CSR_WRITE(sc, WMREG_FCTTV, FCTTV_DFLT);
 
-#if 0 /* XXXJRT */
 	/* Deal with VLAN enables. */
 	if (VLAN_ATTACHED(sc-sc_ethercom))
 		sc-sc_ctrl |= CTRL_VME;
 	else
-#endif /* XXXJRT */
 		sc-sc_ctrl = ~CTRL_VME;
 
 	/* Write the control registers. */
@@ -3282,10 +3276,8 @@
 		CSR_WRITE(sc, WMREG_ITR, sc-sc_itr);
 	}
 
-#if 0 /* XXXJRT */
 	/* Set the VLAN ethernetype. */
 	CSR_WRITE(sc, WMREG_VET, ETHERTYPE_VLAN);
-#endif
 
 	/*
 	 * Set up the transmit control register; we start out with



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

2009-05-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun May  3 17:56:06 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by tls in ticket #627):
sys/dev/pci/if_wm.c: revision 1.172
Missed a small but important change to enable hardware VLAN support.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.5 -r1.162.4.6 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.5 src/sys/dev/pci/if_wm.c:1.162.4.6
--- src/sys/dev/pci/if_wm.c:1.162.4.5	Sun May  3 17:54:07 2009
+++ src/sys/dev/pci/if_wm.c	Sun May  3 17:56:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.5 2009/05/03 17:54:07 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.6 2009/05/03 17:56:05 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.5 2009/05/03 17:54:07 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.6 2009/05/03 17:56:05 snj Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -1546,7 +1546,7 @@
 	 */
 	if (sc-sc_type = WM_T_82543)
 		sc-sc_ethercom.ec_capabilities |=
-		ETHERCAP_VLAN_MTU /* XXXJRT | ETHERCAP_VLAN_HWTAGGING */;
+		ETHERCAP_VLAN_MTU | ETHERCAP_VLAN_HWTAGGING;
 
 	/*
 	 * We can perform TCPv4 and UDPv4 checkums in-bound.  Only



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

2009-05-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun May  3 17:58:41 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #630):
sys/dev/pci/if_wm.c: revision 1.170
Add workaround for 82543GC.
We need to force speed and duplex on the MAC equal to what the PHY
speed and duplex configuration is. Fixes PR#36430.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.6 -r1.162.4.7 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.6 src/sys/dev/pci/if_wm.c:1.162.4.7
--- src/sys/dev/pci/if_wm.c:1.162.4.6	Sun May  3 17:56:05 2009
+++ src/sys/dev/pci/if_wm.c	Sun May  3 17:58:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.6 2009/05/03 17:56:05 snj Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.7 2009/05/03 17:58:41 snj Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.6 2009/05/03 17:56:05 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.7 2009/05/03 17:58:41 snj Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -2769,6 +2769,44 @@
 			(%s: LINK: LSC - mii_tick\n,
 			device_xname(sc-sc_dev)));
 			mii_tick(sc-sc_mii);
+			if (sc-sc_type == WM_T_82543) {
+int miistatus, active;
+
+/*
+ * With 82543, we need to force speed and
+ * duplex on the MAC equal to what the PHY
+ * speed and duplex configuration is.
+ */
+miistatus = sc-sc_mii.mii_media_status;
+
+if (miistatus  IFM_ACTIVE) {
+	active = sc-sc_mii.mii_media_active;
+	sc-sc_ctrl = ~(CTRL_SPEED_MASK
+	| CTRL_FD);
+	switch (IFM_SUBTYPE(active)) {
+	case IFM_10_T:
+		sc-sc_ctrl |= CTRL_SPEED_10;
+		break;
+	case IFM_100_TX:
+		sc-sc_ctrl |= CTRL_SPEED_100;
+		break;
+	case IFM_1000_T:
+		sc-sc_ctrl |= CTRL_SPEED_1000;
+		break;
+	default:
+		/*
+		 * fiber?
+		 * Shoud not enter here.
+		 */
+		printf(unknown media (%x)\n,
+		active);
+		break;
+	}
+	if (active  IFM_FDX)
+		sc-sc_ctrl |= CTRL_FD;
+	CSR_WRITE(sc, WMREG_CTRL, sc-sc_ctrl);
+}
+			}
 		} else if (icr  ICR_RXSEQ) {
 			DPRINTF(WM_DEBUG_LINK,
 			(%s: LINK Receive sequence error\n,



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

2009-05-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun May  3 23:14:57 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #722):
sys/dev/pci/pcidevs: revision 1.973
Attansic L1E Gigabit Ethernet Adapter


To generate a diff of this commit:
cvs rdiff -u -r1.962.4.1 -r1.962.4.2 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.1 src/sys/dev/pci/pcidevs:1.962.4.2
--- src/sys/dev/pci/pcidevs:1.962.4.1	Fri Mar 20 13:01:35 2009
+++ src/sys/dev/pci/pcidevs	Sun May  3 23:14:57 2009
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.1 2009/03/20 13:01:35 msaitoh Exp $
+$NetBSD: pcidevs,v 1.962.4.2 2009/05/03 23:14:57 snj Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1059,6 +1059,7 @@
 product ASUSTEK HFCPCI		0x0675	ISDN
 
 /* Attansic Technology Corp. */
+product ATTANSIC ETHERNET_L1E	0x1026	L1E Gigabit Ethernet Adapter
 product ATTANSIC ETHERNET_GIGA	0x1048	L1 Gigabit Ethernet Adapter
 product ATTANSIC ETHERNET_100	0x2048	L2 100 Mbit Ethernet Adapter
 



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

2009-05-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun May  3 23:16:24 UTC 2009

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

Log Message:
Regen for ticket 722.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.1 -r1.963.4.2 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.1 -r1.962.4.2 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.1 src/sys/dev/pci/pcidevs.h:1.963.4.2
--- src/sys/dev/pci/pcidevs.h:1.963.4.1	Fri Mar 20 13:02:17 2009
+++ src/sys/dev/pci/pcidevs.h	Sun May  3 23:16:22 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.1 2009/03/20 13:02:17 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.2 2009/05/03 23:16:22 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962 2008/10/15 18:30:29 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.2 2009/05/03 23:14:57 snj Exp
  */
 
 /*
@@ -1066,6 +1066,7 @@
 #define	PCI_PRODUCT_ASUSTEK_HFCPCI	0x0675		/* ISDN */
 
 /* Attansic Technology Corp. */
+#define	PCI_PRODUCT_ATTANSIC_ETHERNET_L1E	0x1026		/* L1E Gigabit Ethernet Adapter */
 #define	PCI_PRODUCT_ATTANSIC_ETHERNET_GIGA	0x1048		/* L1 Gigabit Ethernet Adapter */
 #define	PCI_PRODUCT_ATTANSIC_ETHERNET_100	0x2048		/* L2 100 Mbit Ethernet Adapter */
 

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.962.4.1 src/sys/dev/pci/pcidevs_data.h:1.962.4.2
--- src/sys/dev/pci/pcidevs_data.h:1.962.4.1	Fri Mar 20 13:02:17 2009
+++ src/sys/dev/pci/pcidevs_data.h	Sun May  3 23:16:22 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.962.4.1 2009/03/20 13:02:17 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.962.4.2 2009/05/03 23:16:22 snj Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.962 2008/10/15 18:30:29 bouyer Exp
+ *	NetBSD: pcidevs,v 1.962.4.2 2009/05/03 23:14:57 snj Exp
  */
 
 /*
@@ -3824,6 +3824,10 @@
 	ISDN,
 	},
 	{
+	PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_ETHERNET_L1E,
+	L1E Gigabit Ethernet Adapter,
+	},
+	{
 	PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_ETHERNET_GIGA,
 	L1 Gigabit Ethernet Adapter,
 	},
@@ -14512,4 +14516,4 @@
 	Video Controller,
 	},
 };
-const int pci_nproducts = 3027;
+const int pci_nproducts = 3028;



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

2009-04-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri May  1 01:19:09 UTC 2009

Modified Files:
src/sys/dev/pci [netbsd-5]: files.pci
Added Files:
src/sys/dev/pci [netbsd-5]: gcscaudio.c gcscaudioreg.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #260):
sys/dev/pci/files.pci: revision 1.309
sys/dev/pci/gcscaudio.c: revision 1.1
sys/dev/pci/gcscaudioreg.h: revision 1.1
PR# port-i386/40284: add AMD Geode CS5536 audio driver; written by
SHIMIZU Ryo r...@nerv.org


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.308.2.1 src/sys/dev/pci/files.pci
cvs rdiff -u -r0 -r1.1.8.2 src/sys/dev/pci/gcscaudio.c \
src/sys/dev/pci/gcscaudioreg.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/files.pci
diff -u src/sys/dev/pci/files.pci:1.308 src/sys/dev/pci/files.pci:1.308.2.1
--- src/sys/dev/pci/files.pci:1.308	Thu Oct 30 12:02:14 2008
+++ src/sys/dev/pci/files.pci	Fri May  1 01:19:09 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.308 2008/10/30 12:02:14 darran Exp $
+#	$NetBSD: files.pci,v 1.308.2.1 2009/05/01 01:19:09 snj Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -481,6 +481,11 @@
 file	dev/pci/azalia.c		azalia
 file	dev/pci/azalia_codec.c		azalia
 
+# AMD Geode CS5536 Companion Audio
+device	gcscaudio: audiobus, auconv, mulaw, ac97, aurateconv
+attach	gcscaudio at pci
+file	dev/pci/gcscaudio.c		gcscaudio
+
 # NeoMagic 256 AC'97 Audio
 device	neo: audiobus, auconv, mulaw, ac97
 attach	neo at pci

Added files:

Index: src/sys/dev/pci/gcscaudio.c
diff -u /dev/null src/sys/dev/pci/gcscaudio.c:1.1.8.2
--- /dev/null	Fri May  1 01:19:09 2009
+++ src/sys/dev/pci/gcscaudio.c	Fri May  1 01:19:09 2009
@@ -0,0 +1,1339 @@
+/*	$NetBSD: gcscaudio.c,v 1.1.8.2 2009/05/01 01:19:09 snj Exp $	*/
+
+/*-
+ * Copyright (c) 2008 SHIMIZU Ryo r...@nerv.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: gcscaudio.c,v 1.1.8.2 2009/05/01 01:19:09 snj Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/malloc.h
+#include sys/device.h
+#include sys/queue.h
+
+#include uvm/uvm_extern.h
+
+#include dev/pci/pcidevs.h
+#include dev/pci/pcivar.h
+
+#include sys/audioio.h
+#include dev/audio_if.h
+#include dev/mulaw.h
+#include dev/auconv.h
+#include dev/ic/ac97reg.h
+#include dev/ic/ac97var.h
+
+#include dev/pci/gcscaudioreg.h
+
+
+#define	GCSCAUDIO_NPRDTABLE	256	/* including a JMP-PRD for loop */
+#define	GCSCAUDIO_PRD_SIZE_MAX	65532	/* limited by CS5536 Controller */
+#define	GCSCAUDIO_BUFSIZE_MAX	(GCSCAUDIO_PRD_SIZE_MAX * (GCSCAUDIO_NPRDTABLE - 1))
+
+struct gcscaudio_prd {
+	/* PRD table for play/rec */
+	struct gcscaudio_prdtables {
+#define	PRD_TABLE_FRONT		0
+#define	PRD_TABLE_SURR		1
+#define	PRD_TABLE_CENTER	2
+#define	PRD_TABLE_LFE		3
+#define	PRD_TABLE_REC		4
+#define	PRD_TABLE_MAX		5
+		struct acc_prd prdtbl[PRD_TABLE_MAX][GCSCAUDIO_NPRDTABLE];
+	} *p_prdtables;
+	bus_dmamap_t p_prdmap;
+	bus_dma_segment_t p_prdsegs[1];
+	int p_prdnseg;
+};
+
+struct gcscaudio_dma {
+	LIST_ENTRY(gcscaudio_dma) list;
+	bus_dmamap_t map;
+	void *addr;
+	size_t size;
+	bus_dma_segment_t segs[1];
+	int nseg;
+};
+
+struct gcscaudio_softc_ch {
+	void (*ch_intr)(void *);
+	void *ch_intr_arg;
+	struct audio_params ch_params;
+};
+
+struct gcscaudio_softc {
+	struct device sc_dev;
+	pci_chipset_tag_t sc_pc;
+	pcitag_t sc_pt;
+	void *sc_ih;
+	bus_space_tag_t sc_iot;
+	bus_space_handle_t sc_ioh;
+	bus_size_t 

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

2009-03-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Mar 30 16:49:26 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by dholland in ticket #616):
sys/dev/pci/ahcisata_pci.c: revision 1.14
Add the other three PCI ids for the nvidia MCP65 SATA controller to
the quirk table. This way they attach as ahcisata and work, instead of
attaching as viaide and failing miserably.
Fixes PR kern/37826.
XXX: There are a bunch of additional MCP67 and MCP73 PCI ids that
XXX: should probably be added also, but I don't want to do that without
XXX: further investigation and testing.


To generate a diff of this commit:
cvs rdiff -u -r1.12.4.1 -r1.12.4.2 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.1 src/sys/dev/pci/ahcisata_pci.c:1.12.4.2
--- src/sys/dev/pci/ahcisata_pci.c:1.12.4.1	Wed Dec 10 21:55:27 2008
+++ src/sys/dev/pci/ahcisata_pci.c	Mon Mar 30 16:49:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.12.4.1 2008/12/10 21:55:27 snj Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.12.4.2 2009/03/30 16:49:25 snj 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.1 2008/12/10 21:55:27 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahcisata_pci.c,v 1.12.4.2 2009/03/30 16:49:25 snj Exp $);
 
 #include sys/types.h
 #include sys/malloc.h
@@ -54,6 +54,12 @@
 static const struct pci_quirkdata ahci_pci_quirks[] = {
 	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_SATA,
 	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_SATA2,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_SATA3,
+	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_SATA4,
+	AHCI_PCI_QUIRK_FORCE },
 	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP67_SATA,
 	AHCI_PCI_QUIRK_FORCE },
 	{ PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP73_AHCI_1,