Re: CVS commit: src/sys/dev/pci/ixgbe

2020-12-10 Thread SAITOH Masanobu

On 2020/12/11 14:01, SAITOH Masanobu wrote:

Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 11 05:01:19 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_type.h

Log Message:
  Don't use EIMC_OTHER bit because it's read only other than 82598.

  Documents say:

   82598:
  All of bit 31(OTHER bit) of EIxx are reserved. In reality, at least
 EIMS_OTHER and EIMC_OTHER exist and the OTHER interrupt doesn't work
 without EIMS_OTHER.

   Other than 82598:


+  EICR's bit 31 is defined and other EIXX's bit 31 are reserved.
+  In reality,


  EIMS_OTHER is read only and EIMC_OTHER doesn't exist. If one of
 bit 29..16 is set, EIMS_OTHER is set to 1 (Note that bit 30(TCP timer
 isn't included)). Even if write bit 31 of EIMC to 1, it's ignored
 (EIMS_OTHER doesn't set).

  We introduced new spin mutex in ixgbe.c rev. 1.260, so it's OK to remove
EIMC_OTHER stuff. We already set EIMS_OTHER in if_init(), so keep it for
82598. No functional change other than 82598.

  Another solution is to control bit 30..16 directly to mask/unmask interrupt
instead of the mutex.

TODO:
   Some MSI-X interrupt(LSC, module insertion/removal etc.)'s mask/unmask
   code between ixgbe_msix_admin() and ixgbe_handle_admin() may be wrong.
   It'll be fixed later.


To generate a diff of this commit:
cvs rdiff -u -r1.261 -r1.262 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pci/ixgbe/ixgbe_type.h

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




--
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/sys/dev/pci

2020-10-16 Thread SAITOH Masanobu

On 2020/10/16 14:53, SAITOH Masanobu wrote:

Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 16 05:53:40 UTC 2020

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
  Fixes a problem that the attach function reported
"wm_gmii_setup_phytype: Unknown PHY model. OUI=00, model=" and
"PHY type is still unknown."


This was dmesg only problem. The SGMII read/write functions were correctly set
even though error message was printed. This problem was added in if_wm.c
rev. 1.656 which added SFP support.


Don't call wm_gmii_setup_phytype() three times if
the interface uses SGMII with internal MDIO.

  Tested with I354(Rangeley(SGMII(MDIO))) and I350(SERDES(SFP), SGMII(SFP)).


To generate a diff of this commit:
cvs rdiff -u -r1.690 -r1.691 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.




--
---
    SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/sys/dev/mii

2020-08-03 Thread SAITOH Masanobu

On 2020/08/04 12:50, SAITOH Masanobu wrote:

Hi.

On 2020/08/03 23:00, Valeriy E. Ushakov wrote:

Module Name:    src
Committed By:    uwe
Date:    Mon Aug  3 14:00:41 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs_data.h

Log Message:
mii_knowndevs[] is de facto const, define it as such.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/dev/mii/miidevs_data.h

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



This file is auto-generated by Makefile.miidevs. make -f Makefile.miidevs
deletes this change. If the change is required, modify Makefile.miidevs.


s/modify Makefile.miidevs/modify devlist2h.awk/


Thanks.




--
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/sys/dev/mii

2020-08-03 Thread SAITOH Masanobu

Hi.

On 2020/08/03 23:00, Valeriy E. Ushakov wrote:

Module Name:src
Committed By:   uwe
Date:   Mon Aug  3 14:00:41 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs_data.h

Log Message:
mii_knowndevs[] is de facto const, define it as such.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/dev/mii/miidevs_data.h

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



This file is auto-generated by Makefile.miidevs. make -f Makefile.miidevs
deletes this change. If the change is required, modify Makefile.miidevs.

Thanks.

--
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/share/man/man4

2020-04-09 Thread SAITOH Masanobu

On 2020/04/10 2:42, David Young wrote:

On Thu, Apr 09, 2020 at 03:25:32PM +0900, SAITOH Masanobu wrote:

On 2020/04/09 11:08, David Young wrote:

On Wed, Apr 08, 2020 at 11:01:52PM +, Jaromir Dolecek wrote:

on I219 I observe about 35% transmit performance drop when tso4 enabled


This sounds familiar.  There was a bug affecting TCP segmentation
offload (I think) that we found at CoyotePoint.  ISTR
bus_dmamap_load_mbuf(9) failed with EFBIG because under some
circumstances the number of segments in the DMA map was too small
for the mbuf chain.  The driver would drop the whole mbuf chain
on the floor.  This showed up as terrible performance under some
circumstances---possibly when the TCP window grew long?  The solution
was to increase the number of DMA segments, *I think*.


m_defrag() was added to -current in September 2018, and 9.0,
8.1, post 7.2 have this code.


Thank you, that's just the change I was thinking of.


You're welcome.
Some drivers still have no m_defrag() code, so we should add it
to them().


Dave




--
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/share/man/man4

2020-04-09 Thread SAITOH Masanobu

Hi.

On 2020/04/09 11:08, David Young wrote:

On Wed, Apr 08, 2020 at 11:01:52PM +, Jaromir Dolecek wrote:

Module Name:src
Committed By:   jdolecek
Date:   Wed Apr  8 23:01:52 UTC 2020

Modified Files:
src/share/man/man4: wm.4

Log Message:
add a warning in checksum offload that hardware TCP segmentation might be
slow

on I219 I observe about 35% transmit performance drop when tso4 enabled


This sounds familiar.  There was a bug affecting TCP segmentation
offload (I think) that we found at CoyotePoint.  ISTR
bus_dmamap_load_mbuf(9) failed with EFBIG because under some
circumstances the number of segments in the DMA map was too small
for the mbuf chain.  The driver would drop the whole mbuf chain
on the floor.  This showed up as terrible performance under some
circumstances---possibly when the TCP window grew long?  The solution
was to increase the number of DMA segments, *I think*.

I don't think CoyotePoint ever fed its change back to NetBSD,
unfortunately.  On the other hand, some other NetBSDer may have
independently fixed the bug.

Do any stats increase (vmstat -e, ifconfig -v wm0) when the poor
performance occurs? You may have to enable WM_DEBUG or something to see
all of the relevant stats.


m_defrag() was added to -current in September 2018, and 9.0,
8.1, post 7.2 have this code.


http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/pci/if_wm.c.diff?r1=1.586=1.587=date=h

The driver has wmX txqYYtoomanyseg event counter, so we can check it
by enabling "options WM_EVENT_COUNTERS". The counter is disabled by
default.


Dave




--
---
        SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/sys/dev/ic

2020-03-23 Thread SAITOH Masanobu
On 2020/03/24 12:45, SAITOH Masanobu wrote:
> Module Name:  src
> Committed By: msaitoh
> Date: Tue Mar 24 03:45:26 UTC 2020
> 
> Modified Files:
>   src/sys/dev/ic: spdmem.c spdmemvar.h
> 
> Log Message:
> - Define some new parameters of DDR3 SPD ROM.
> - Use fine timebase parameters for time calculation on DDR3. This change
>   makes PC3- value

+ and tAA-tRCD-tRP value

> more correctly on newer DD3.>
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.33 -r1.34 src/sys/dev/ic/spdmem.c
> cvs rdiff -u -r1.14 -r1.15 src/sys/dev/ic/spdmemvar.h
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 


-- 
-------
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/sys [freeze on boot]

2020-01-21 Thread SAITOH Masanobu
On 2020/01/21 20:20, Patrick Welche wrote:
> On Tue, Jan 21, 2020 at 03:48:27PM +0900, Masanobu SAITOH wrote:
>> I suspect the location of your panic is after the following message
>> (because of ixgbe_allocate_msix()'s failure):
>>
>>> aprint_normal(" ETrackID %08x\n", ((uint32_t)high << 16) | low);
> 
> Exactly right:
> 
> ixg0 at pci8 dev 0 function 0: Intel(R) PRO/10GbE PCI-Express Network Driver, 
> Version - 4.0.1-k
> ixg0: device 82599EB
> ixg0: ETrackID 81a5
> ixg0: autoconfiguration error: failed to allocate MSI-X interrupt
> 
>> If so, could you try the following diff?
> 
> That fixed it, thanks! (with ad@'s rwlock fix and your patch all permutations
> work)

Committed.

Thanks!


> Cheers,
> 
> Patrick
> 


-- 
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


CVS commit: src/sys/dev/pci

2019-11-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov 29 15:17:14 UTC 2019

Modified Files:
src/sys/dev/pci: if_mcx.c

Log Message:
Set if_baudrate.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_mcx.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_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.8 src/sys/dev/pci/if_mcx.c:1.9
--- src/sys/dev/pci/if_mcx.c:1.8	Thu Nov 28 16:02:07 2019
+++ src/sys/dev/pci/if_mcx.c	Fri Nov 29 15:17:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcx.c,v 1.8 2019/11/28 16:02:07 msaitoh Exp $ */
+/*	$NetBSD: if_mcx.c,v 1.9 2019/11/29 15:17:14 msaitoh Exp $ */
 /*	$OpenBSD: if_mcx.c,v 1.33 2019/09/12 04:23:59 jmatthew Exp $ */
 
 /*
@@ -6653,6 +6653,7 @@ mcx_port_change(struct work *wk, void *x
 	struct ifnet *ifp = >sc_ec.ec_if;
 	struct mcx_reg_paos paos;
 	int link_state = LINK_STATE_DOWN;
+	struct ifmediareq ifmr;
 
 	memset(, 0, sizeof(paos));
 	paos.rp_local_port = 1;
@@ -6660,6 +6661,8 @@ mcx_port_change(struct work *wk, void *x
 	sizeof(paos)) == 0) {
 		if (paos.rp_oper_status == MCX_REG_PAOS_OPER_STATUS_UP)
 			link_state = LINK_STATE_UP;
+		mcx_media_status(ifp, );
+		ifp->if_baudrate = ifmedia_baudrate(ifmr.ifm_active);
 	}
 
 	if (link_state != ifp->if_link_state) {



CVS commit: src/sys/dev/pci

2019-11-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov 29 15:17:14 UTC 2019

Modified Files:
src/sys/dev/pci: if_mcx.c

Log Message:
Set if_baudrate.


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

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



CVS commit: src/sys/dev/pci

2019-11-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 28 16:02:07 UTC 2019

Modified Files:
src/sys/dev/pci: if_mcx.c

Log Message:
- Change IFM_10G_T(10GBase-T) entry to IFM_10G_CR1(10GBASE-CR1)
- Add the following entries:

20GBASE-KR2
56GBASE-R4
100GBASE-LR4
100BaseTX
1000baseT
10GBase-T


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_mcx.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_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.7 src/sys/dev/pci/if_mcx.c:1.8
--- src/sys/dev/pci/if_mcx.c:1.7	Tue Nov 26 10:33:19 2019
+++ src/sys/dev/pci/if_mcx.c	Thu Nov 28 16:02:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcx.c,v 1.7 2019/11/26 10:33:19 jmcneill Exp $ */
+/*	$NetBSD: if_mcx.c,v 1.8 2019/11/28 16:02:07 msaitoh Exp $ */
 /*	$OpenBSD: if_mcx.c,v 1.33 2019/09/12 04:23:59 jmatthew Exp $ */
 
 /*
@@ -159,8 +159,10 @@
 #define MCX_ETHER_CAP_10G_CX4	(1 << 2)
 #define MCX_ETHER_CAP_10G_KX4	(1 << 3)
 #define MCX_ETHER_CAP_10G_KR	(1 << 4)
+#define MCX_ETHER_CAP_20G_KR2	(1 << 5)
 #define MCX_ETHER_CAP_40G_CR4	(1 << 6)
 #define MCX_ETHER_CAP_40G_KR4	(1 << 7)
+#define MCX_ETHER_CAP_56G_R4	(1 << 8)
 #define MCX_ETHER_CAP_10G_CR	(1 << 12)
 #define MCX_ETHER_CAP_10G_SR	(1 << 13)
 #define MCX_ETHER_CAP_10G_LR	(1 << 14)
@@ -170,6 +172,10 @@
 #define MCX_ETHER_CAP_100G_CR4	(1 << 20)
 #define MCX_ETHER_CAP_100G_SR4	(1 << 21)
 #define MCX_ETHER_CAP_100G_KR4	(1 << 22)
+#define MCX_ETHER_CAP_100G_LR4	(1 << 23)
+#define MCX_ETHER_CAP_100_TX	(1 << 24)
+#define MCX_ETHER_CAP_1000_T	(1 << 25)
+#define MCX_ETHER_CAP_10G_T	(1 << 26)
 #define MCX_ETHER_CAP_25G_CR	(1 << 27)
 #define MCX_ETHER_CAP_25G_KR	(1 << 28)
 #define MCX_ETHER_CAP_25G_SR	(1 << 29)
@@ -2146,14 +2152,14 @@ static const uint64_t mcx_eth_cap_map[] 
 	IFM_10G_CX4,
 	IFM_10G_KX4,
 	IFM_10G_KR,
-	0,
+	IFM_20G_KR2,
 	IFM_40G_CR4,
 	IFM_40G_KR4,
+	IFM_56G_R4,
 	0,
 	0,
 	0,
-	0,
-	IFM_10G_T,
+	IFM_10G_CR1,
 	IFM_10G_SR,
 	IFM_10G_LR,
 	IFM_40G_SR4,
@@ -2164,10 +2170,10 @@ static const uint64_t mcx_eth_cap_map[] 
 	IFM_100G_CR4,
 	IFM_100G_SR4,
 	IFM_100G_KR4,
-	0,
-	0,
-	0,
-	0,
+	IFM_100G_LR4,
+	IFM_100_TX,
+	IFM_1000_T,
+	IFM_10G_T,
 	IFM_25G_CR,
 	IFM_25G_KR,
 	IFM_25G_SR,



CVS commit: src/sys/dev/pci

2019-11-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 28 16:02:07 UTC 2019

Modified Files:
src/sys/dev/pci: if_mcx.c

Log Message:
- Change IFM_10G_T(10GBase-T) entry to IFM_10G_CR1(10GBASE-CR1)
- Add the following entries:

20GBASE-KR2
56GBASE-R4
100GBASE-LR4
100BaseTX
1000baseT
10GBase-T


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

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



CVS commit: src/sys/net

2019-11-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 28 14:08:22 UTC 2019

Modified Files:
src/sys/net: if_media.h

Log Message:
 Fix comment. The ifm_media member of struct ifmedia is NOT user-set media
word but the current "active" media.

 The user-set media word is one of the ifmedia_entry's ifm_media(A) that
ifm_cur points to (e.g. IFM_AUTO). It can be taken as ifmediareq's ifm_current
entry. The current active media word is the ifm_media(B) entry of struct
ifmedia (e.g 1000baseTX-FDX as the result of auto negotiation). It can be
taken as ifmediareq's ifm_active entry.

struct ifmedia_entry {
TAILQ_ENTRY(ifmedia_entry) ifm_list;
u_int   ifm_media;  /* IFMWD: description of this media */ /* A */
u_int   ifm_data;   /* for driver-specific use */
void*ifm_aux;   /* for driver-specific use */
};

struct ifmedia {
u_int   ifm_mask;   /* IFMWD: mask of changes we don't care */
u_int   ifm_media;  /* IFMWD: current active media word */ /* B */
struct ifmedia_entry *ifm_cur;  /* current user-selected media */
TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */
ifm_change_cb_t ifm_change; /* media change driver callback */
ifm_stat_cb_t   ifm_status; /* media status driver callback */
};

So:

in kernel   SIOCGIFMEDIA(ifmediareq)
-
user-setting:   ifm->ifm_cur->ifm_media ifm_current
current active: ifm->ifm_media  ifm_active

It would be good to rename some members to make those meaning clear.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/net/if_media.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/net/if_media.h
diff -u src/sys/net/if_media.h:1.66 src/sys/net/if_media.h:1.67
--- src/sys/net/if_media.h:1.66	Thu Oct  3 14:41:14 2019
+++ src/sys/net/if_media.h	Thu Nov 28 14:08:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media.h,v 1.66 2019/10/03 14:41:14 jmcneill Exp $	*/
+/*	$NetBSD: if_media.h,v 1.67 2019/11/28 14:08:22 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -872,7 +872,7 @@ typedef	void (*ifm_stat_cb_t)(struct ifn
  */
 struct ifmedia_entry {
 	TAILQ_ENTRY(ifmedia_entry) ifm_list;
-	u_int	ifm_media;	/* description of this media attachment */
+	u_int	ifm_media;	/* IFMWD: description of this media */
 	u_int	ifm_data;	/* for driver-specific use */
 	void	*ifm_aux;	/* for driver-specific use */
 };
@@ -882,9 +882,9 @@ struct ifmedia_entry {
  * It is used to keep general media state.
  */
 struct ifmedia {
-	u_int	ifm_mask;	/* mask of changes we don't care about */
-	u_int	ifm_media;	/* current user-set media word */
-	struct ifmedia_entry *ifm_cur;	/* currently selected media */
+	u_int	ifm_mask;	/* IFMWD: mask of changes we don't care */
+	u_int	ifm_media;	/* IFMWD: current active media word */
+	struct ifmedia_entry *ifm_cur;	/* current user-selected media */
 	TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */
 	ifm_change_cb_t	ifm_change;	/* media change driver callback */
 	ifm_stat_cb_t	ifm_status;	/* media status driver callback */



CVS commit: src/sys/net

2019-11-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 28 14:08:22 UTC 2019

Modified Files:
src/sys/net: if_media.h

Log Message:
 Fix comment. The ifm_media member of struct ifmedia is NOT user-set media
word but the current "active" media.

 The user-set media word is one of the ifmedia_entry's ifm_media(A) that
ifm_cur points to (e.g. IFM_AUTO). It can be taken as ifmediareq's ifm_current
entry. The current active media word is the ifm_media(B) entry of struct
ifmedia (e.g 1000baseTX-FDX as the result of auto negotiation). It can be
taken as ifmediareq's ifm_active entry.

struct ifmedia_entry {
TAILQ_ENTRY(ifmedia_entry) ifm_list;
u_int   ifm_media;  /* IFMWD: description of this media */ /* A */
u_int   ifm_data;   /* for driver-specific use */
void*ifm_aux;   /* for driver-specific use */
};

struct ifmedia {
u_int   ifm_mask;   /* IFMWD: mask of changes we don't care */
u_int   ifm_media;  /* IFMWD: current active media word */ /* B */
struct ifmedia_entry *ifm_cur;  /* current user-selected media */
TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */
ifm_change_cb_t ifm_change; /* media change driver callback */
ifm_stat_cb_t   ifm_status; /* media status driver callback */
};

So:

in kernel   SIOCGIFMEDIA(ifmediareq)
-
user-setting:   ifm->ifm_cur->ifm_media ifm_current
current active: ifm->ifm_media  ifm_active

It would be good to rename some members to make those meaning clear.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/net/if_media.h

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



CVS commit: [netbsd-9] src/doc

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 13:40:18 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #489.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.122 -r1.1.2.123 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.122 src/doc/CHANGES-9.0:1.1.2.123
--- src/doc/CHANGES-9.0:1.1.2.122	Wed Nov 27 11:22:13 2019
+++ src/doc/CHANGES-9.0	Wed Nov 27 13:40:18 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.122 2019/11/27 11:22:13 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.123 2019/11/27 13:40:18 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -6491,3 +6491,22 @@ sys/dev/mii/ipgphy.c1.7
 	Print dmesg correctly.
 	[msaitoh, ticket #490]
 
+distrib/notes/Makefile.inc			1.46
+distrib/notes/common/list-portmasters.pl	delete
+distrib/notes/common/macros			1.44
+distrib/notes/common/main			1.555-1.557 via patch
+distrib/notes/common/netboot			1.38
+distrib/notes/common/postinstall		1.86
+distrib/notes/common/sysinst			1.110
+distrib/notes/sparc/prep			1.28-1.29
+distrib/notes/sparc64/prep			1.16
+
+	- Remove list-portmasters.pl script.
+	- Quote long .Ss2 title to avoid troff's limitation.
+	- Simplify TOC handling and remove arg limit (from uwe).
+	- Use Lk with explicit anchor text in some places.
+	- Do not allow official release builds when we can not derive the
+	  proper date from the buildid.
+	- Add "Oxford comma".
+	- Improve heading a bit.
+	[martin, ticket #489]



CVS commit: [netbsd-9] src/doc

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 13:40:18 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #489.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.122 -r1.1.2.123 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/distrib/notes

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 13:36:55 UTC 2019

Modified Files:
src/distrib/notes [netbsd-9]: Makefile.inc
src/distrib/notes/common [netbsd-9]: macros main netboot postinstall
sysinst
src/distrib/notes/sparc [netbsd-9]: prep
src/distrib/notes/sparc64 [netbsd-9]: prep
Removed Files:
src/distrib/notes/common [netbsd-9]: list-portmasters.pl

Log Message:
Pull up following revision(s) (requested by martin in ticket #489):
distrib/notes/Makefile.inc: revision 1.46
distrib/notes/common/postinstall: revision 1.86
distrib/notes/sparc64/prep: revision 1.16
distrib/notes/common/netboot: revision 1.38
distrib/notes/common/main: revision 1.555
distrib/notes/common/main: revision 1.556
distrib/notes/common/main: revision 1.557
distrib/notes/common/macros: revision 1.44
distrib/notes/common/sysinst: revision 1.110
distrib/notes/sparc/prep: revision 1.28
distrib/notes/sparc/prep: revision 1.29
distrib/notes/common/list-portmasters.pl: file removal
Remove list-portmasters.pl script.
We dropped that list from "main" some time ago.
Quote long .Ss2 title to avoid troff's limitation.
Troff is limited to 9 macro parameters and this title is 10 words, so
we lose the last word here when we pass arguments around.  We have
more titles like that but for now I wanted to commit only one just to
flag the problem.
More cleanup:
 - simplify TOC handling and remove arg limit (from uwe)
 - use Lk with explicit anchor text in some places
 - do not allow official release builds when we can not derive the
   proper date from the buildid
Add "Oxford comma"
Improve heading a bit.  While here, use quotes to group some of the
words to avoid the 9-arg limitation of .Ss


To generate a diff of this commit:
cvs rdiff -u -r1.43.18.2 -r1.43.18.3 src/distrib/notes/Makefile.inc
cvs rdiff -u -r1.6 -r0 src/distrib/notes/common/list-portmasters.pl
cvs rdiff -u -r1.43 -r1.43.6.1 src/distrib/notes/common/macros
cvs rdiff -u -r1.551.2.2 -r1.551.2.3 src/distrib/notes/common/main
cvs rdiff -u -r1.36.18.1 -r1.36.18.2 src/distrib/notes/common/netboot
cvs rdiff -u -r1.83.2.2 -r1.83.2.3 src/distrib/notes/common/postinstall
cvs rdiff -u -r1.107.6.2 -r1.107.6.3 src/distrib/notes/common/sysinst
cvs rdiff -u -r1.27 -r1.27.18.1 src/distrib/notes/sparc/prep
cvs rdiff -u -r1.15 -r1.15.50.1 src/distrib/notes/sparc64/prep

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

Modified files:

Index: src/distrib/notes/Makefile.inc
diff -u src/distrib/notes/Makefile.inc:1.43.18.2 src/distrib/notes/Makefile.inc:1.43.18.3
--- src/distrib/notes/Makefile.inc:1.43.18.2	Mon Nov 25 05:50:15 2019
+++ src/distrib/notes/Makefile.inc	Wed Nov 27 13:36:55 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.43.18.2 2019/11/25 05:50:15 msaitoh Exp $
+#	$NetBSD: Makefile.inc,v 1.43.18.3 2019/11/27 13:36:55 msaitoh Exp $
 #
 
 # Ross Harvey 
@@ -51,8 +51,12 @@ PRESET+=	-rnextminor=${nextmin}
 .if defined(BUILDID) && "${BUILDID:M20*Z}" != ""
 curdate!=	env LANG="C" date -d "${BUILDID:C/[0-9][0-9][0-9][0-9]Z$//}" "+%b %d, %Y"
 .else
+.if ${NETBSD_OFFICIAL_RELEASE:Uno} == "yes"
+.error "No release date could be derived from BUILDID"
+.else
 curdate!=	env LANG="C" date "+%b %d, %Y"
 .endif
+.endif
 PRESET+=	-dcur_date="${curdate}"
 
 POST_PLAIN= -P-b -P-u -P-o
@@ -103,8 +107,7 @@ ${TARG}.more: ${SRCS} ${TOC.more} ${DIST
 # space taken by the TOC itself.
 #
 
-TOCPROC=	   2>&1 >/dev/null |\
-   ${TOOL_SED} -n '/^\.Ti/{s/ \([A-Za-z]\)/ "\1/; s/ *$$/"/; p; }'
+TOCPROC=	   2>&1 >/dev/null | ${TOOL_GREP} -e '^\.Ti '
 
 ${TARG}.PostScript.toc: ${SRCS}
 	${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
@@ -121,8 +124,6 @@ ${TARG}.ASCII.toc: ${SRCS}
 ${TARG}.HTML.toc: ${SRCS}
 	${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
 	mv -f $@.tmp $@
-	${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
-	mv -f $@.tmp $@
 
 ${TARG}.more.toc: ${SRCS}
 	${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp

Index: src/distrib/notes/common/macros
diff -u src/distrib/notes/common/macros:1.43 src/distrib/notes/common/macros:1.43.6.1
--- src/distrib/notes/common/macros:1.43	Wed Jan 24 09:04:41 2018
+++ src/distrib/notes/common/macros	Wed Nov 27 13:36:55 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: macros,v 1.43 2018/01/24 09:04:41 skrll Exp $
+.\"	$NetBSD: macros,v 1.43.6.1 2019/11/27 13:36:55 msaitoh Exp $
 .\"
 .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -312,13 +312,13 @@
 .if dTOC \{
 .rn Ss Ss-toc
 .de Ss
-.Ss-toc \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-\.tm .Ti 0 \\n% \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.Ss-toc \\$@
+.tm .Ti 0 \\n% "\\$*"
 ..
 .rn Ss2 Ss2-toc
 .de Ss2
-.Ss2-toc \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-\.tm .Ti 1 \\n% \\$1 

CVS commit: [netbsd-9] src/distrib/notes

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 13:36:55 UTC 2019

Modified Files:
src/distrib/notes [netbsd-9]: Makefile.inc
src/distrib/notes/common [netbsd-9]: macros main netboot postinstall
sysinst
src/distrib/notes/sparc [netbsd-9]: prep
src/distrib/notes/sparc64 [netbsd-9]: prep
Removed Files:
src/distrib/notes/common [netbsd-9]: list-portmasters.pl

Log Message:
Pull up following revision(s) (requested by martin in ticket #489):
distrib/notes/Makefile.inc: revision 1.46
distrib/notes/common/postinstall: revision 1.86
distrib/notes/sparc64/prep: revision 1.16
distrib/notes/common/netboot: revision 1.38
distrib/notes/common/main: revision 1.555
distrib/notes/common/main: revision 1.556
distrib/notes/common/main: revision 1.557
distrib/notes/common/macros: revision 1.44
distrib/notes/common/sysinst: revision 1.110
distrib/notes/sparc/prep: revision 1.28
distrib/notes/sparc/prep: revision 1.29
distrib/notes/common/list-portmasters.pl: file removal
Remove list-portmasters.pl script.
We dropped that list from "main" some time ago.
Quote long .Ss2 title to avoid troff's limitation.
Troff is limited to 9 macro parameters and this title is 10 words, so
we lose the last word here when we pass arguments around.  We have
more titles like that but for now I wanted to commit only one just to
flag the problem.
More cleanup:
 - simplify TOC handling and remove arg limit (from uwe)
 - use Lk with explicit anchor text in some places
 - do not allow official release builds when we can not derive the
   proper date from the buildid
Add "Oxford comma"
Improve heading a bit.  While here, use quotes to group some of the
words to avoid the 9-arg limitation of .Ss


To generate a diff of this commit:
cvs rdiff -u -r1.43.18.2 -r1.43.18.3 src/distrib/notes/Makefile.inc
cvs rdiff -u -r1.6 -r0 src/distrib/notes/common/list-portmasters.pl
cvs rdiff -u -r1.43 -r1.43.6.1 src/distrib/notes/common/macros
cvs rdiff -u -r1.551.2.2 -r1.551.2.3 src/distrib/notes/common/main
cvs rdiff -u -r1.36.18.1 -r1.36.18.2 src/distrib/notes/common/netboot
cvs rdiff -u -r1.83.2.2 -r1.83.2.3 src/distrib/notes/common/postinstall
cvs rdiff -u -r1.107.6.2 -r1.107.6.3 src/distrib/notes/common/sysinst
cvs rdiff -u -r1.27 -r1.27.18.1 src/distrib/notes/sparc/prep
cvs rdiff -u -r1.15 -r1.15.50.1 src/distrib/notes/sparc64/prep

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



CVS commit: src/sys

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 10:19:21 UTC 2019

Modified Files:
src/sys/arch/arm/amlogic: gxlphy.c
src/sys/dev/mii: acphy.c amhphy.c atphy.c bmtphy.c brgphy.c ciphy.c
dmphy.c etphy.c exphy.c gentbi.c glxtphy.c gphyter.c icsphy.c
igphy.c ihphy.c ikphy.c inphy.c iophy.c ipgphy.c jmphy.c lxtphy.c
makphy.c micphy.c mii_physubr.c mvphy.c nsphy.c nsphyter.c pnaphy.c
qsphy.c rdcphy.c rgephy.c rlphy.c smscphy.c sqphy.c tlphy.c tqphy.c
ukphy.c urlphy.c

Log Message:
- Simplify sc->mii_anegticks setting. Same as FreeBSD.

   Don't set the default value not in the attach function. Instead, set the
  default value (MII_ANEGTICKS) first in the beginning of the
  mii_phy_add_media(). The function already has the code to change the value to
  MII_ANEGTICKS_GIGE if it's gigabit capable.

- Remove extra pmf_device_register() call. It's done in mii_phy_add_media().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/amlogic/gxlphy.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/mii/acphy.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/mii/amhphy.c src/sys/dev/mii/pnaphy.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/mii/bmtphy.c src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/mii/brgphy.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/mii/ciphy.c src/sys/dev/mii/rlphy.c
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/mii/dmphy.c src/sys/dev/mii/nsphyter.c \
src/sys/dev/mii/tqphy.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/etphy.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/mii/exphy.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/gentbi.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/mii/glxtphy.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/mii/icsphy.c src/sys/dev/mii/sqphy.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/mii/igphy.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/mii/ihphy.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/mii/ikphy.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/mii/inphy.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/mii/iophy.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/mii/ipgphy.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/jmphy.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/lxtphy.c src/sys/dev/mii/qsphy.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/mii/micphy.c
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/mii/mvphy.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/mii/nsphy.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/rdcphy.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/mii/rgephy.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/smscphy.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/mii/tlphy.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/mii/ukphy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/urlphy.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/arch/arm/amlogic/gxlphy.c
diff -u src/sys/arch/arm/amlogic/gxlphy.c:1.1 src/sys/arch/arm/amlogic/gxlphy.c:1.2
--- src/sys/arch/arm/amlogic/gxlphy.c:1.1	Sun Apr 21 11:02:32 2019
+++ src/sys/arch/arm/amlogic/gxlphy.c	Wed Nov 27 10:19:21 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gxlphy.c,v 1.1 2019/04/21 11:02:32 jmcneill Exp $ */
+/* $NetBSD: gxlphy.c,v 1.2 2019/11/27 10:19:21 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2019 Jared McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gxlphy.c,v 1.1 2019/04/21 11:02:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gxlphy.c,v 1.2 2019/11/27 10:19:21 msaitoh Exp $");
 
 #include 
 #include 
@@ -168,7 +168,6 @@ gxlphyattach(device_t parent, device_t s
 	sc->mii_funcs = _funcs;
 	sc->mii_pdata = mii;
 	sc->mii_flags = ma->mii_flags;
-	sc->mii_anegticks = MII_ANEGTICKS;
 
 	PHY_RESET(sc);
 
@@ -180,13 +179,8 @@ gxlphyattach(device_t parent, device_t s
 	sc->mii_capabilities &= ma->mii_capmask;
 	if (sc->mii_capabilities & BMSR_EXTSTAT)
 		PHY_READ(sc, MII_EXTSR, >mii_extcapabilities);
-	aprint_normal_dev(self, "");
-	if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 &&
-	(sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0)
-		aprint_error("no media present");
-	else
-		mii_phy_add_media(sc);
-	aprint_normal("\n");
+
+	mii_phy_add_media(sc);
 }
 
 static int

Index: src/sys/dev/mii/acphy.c
diff -u src/sys/dev/mii/acphy.c:1.28 src/sys/dev/mii/acphy.c:1.29
--- src/sys/dev/mii/acphy.c:1.28	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/acphy.c	Wed Nov 27 10:19:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: acphy.c,v 1.28 2019/03/25 09:20:46 msaitoh Exp $	*/
+/*	$NetBSD: acphy.c,v 1.29 2019/11/27 10:19:20 msaitoh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.28 2019/03/25 09:20:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.29 2019/11/27 10:19:20 msaitoh Exp $");
 
 #include 
 #include 
@@ -110,7 +110,6 @@ acphyattach(device_t parent, 

CVS commit: src/sys

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 10:19:21 UTC 2019

Modified Files:
src/sys/arch/arm/amlogic: gxlphy.c
src/sys/dev/mii: acphy.c amhphy.c atphy.c bmtphy.c brgphy.c ciphy.c
dmphy.c etphy.c exphy.c gentbi.c glxtphy.c gphyter.c icsphy.c
igphy.c ihphy.c ikphy.c inphy.c iophy.c ipgphy.c jmphy.c lxtphy.c
makphy.c micphy.c mii_physubr.c mvphy.c nsphy.c nsphyter.c pnaphy.c
qsphy.c rdcphy.c rgephy.c rlphy.c smscphy.c sqphy.c tlphy.c tqphy.c
ukphy.c urlphy.c

Log Message:
- Simplify sc->mii_anegticks setting. Same as FreeBSD.

   Don't set the default value not in the attach function. Instead, set the
  default value (MII_ANEGTICKS) first in the beginning of the
  mii_phy_add_media(). The function already has the code to change the value to
  MII_ANEGTICKS_GIGE if it's gigabit capable.

- Remove extra pmf_device_register() call. It's done in mii_phy_add_media().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/amlogic/gxlphy.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/mii/acphy.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/mii/amhphy.c src/sys/dev/mii/pnaphy.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/mii/bmtphy.c src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/mii/brgphy.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/mii/ciphy.c src/sys/dev/mii/rlphy.c
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/mii/dmphy.c src/sys/dev/mii/nsphyter.c \
src/sys/dev/mii/tqphy.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/etphy.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/mii/exphy.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/gentbi.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/mii/glxtphy.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/mii/icsphy.c src/sys/dev/mii/sqphy.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/mii/igphy.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/mii/ihphy.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/mii/ikphy.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/mii/inphy.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/mii/iophy.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/mii/ipgphy.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/jmphy.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/lxtphy.c src/sys/dev/mii/qsphy.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/mii/micphy.c
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/mii/mvphy.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/mii/nsphy.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/rdcphy.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/mii/rgephy.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/smscphy.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/mii/tlphy.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/mii/ukphy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/urlphy.c

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



CVS commit: src/sys/dev/mii

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 08:53:32 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 Print dmesg correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/ipgphy.c

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

Modified files:

Index: src/sys/dev/mii/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.6 src/sys/dev/mii/ipgphy.c:1.7
--- src/sys/dev/mii/ipgphy.c:1.6	Thu Nov 21 09:48:57 2019
+++ src/sys/dev/mii/ipgphy.c	Wed Nov 27 08:53:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipgphy.c,v 1.6 2019/11/21 09:48:57 msaitoh Exp $ */
+/*	$NetBSD: ipgphy.c,v 1.7 2019/11/27 08:53:32 msaitoh Exp $ */
 /*	$OpenBSD: ipgphy.c,v 1.19 2015/07/19 06:28:12 yuo Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.6 2019/11/21 09:48:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.7 2019/11/27 08:53:32 msaitoh Exp $");
 
 #include 
 #include 
@@ -119,6 +119,7 @@ ipgphy_attach(device_t parent, device_t 
 	if (sc->mii_capabilities & BMSR_EXTSTAT)
 		PHY_READ(sc, MII_EXTSR, >mii_extcapabilities);
 
+	aprint_normal_dev(self, "");
 	mii_phy_add_media(sc);
 	aprint_normal("\n");
 }



CVS commit: src/sys/dev/mii

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 08:53:32 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 Print dmesg correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/ipgphy.c

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



CVS commit: src/sys/dev/pci

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 03:47:06 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1379 -r1.1380 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1378 -r1.1379 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.



CVS commit: src/sys/dev/pci

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 03:45:54 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
- Add Xeon D-1500 NTB-secondary
- Add Xeon D NS QuickData DMA channel 0-7


To generate a diff of this commit:
cvs rdiff -u -r1.1391 -r1.1392 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.1391 src/sys/dev/pci/pcidevs:1.1392
--- src/sys/dev/pci/pcidevs:1.1391	Thu Nov 14 09:10:41 2019
+++ src/sys/dev/pci/pcidevs	Wed Nov 27 03:45:54 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1391 2019/11/14 09:10:41 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1392 2019/11/27 03:45:54 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4995,6 +4995,7 @@ product INTEL XEOND_PCIE_9	0x6f0a	Core i
 product INTEL XEOND_PCIE_10	0x6f0b	Core i7-6xxxK/Xeon-D PCIe Root Port (x16, x8 or x4 max)
 product INTEL XEOND_PCIE_NTBNTB	0x6f0d	Xeon-D PCIe Root Port NTB-NTB
 product INTEL XEOND_PCIE_NTBRP	0x6f0e	Xeon-D PCIe Root Port NTB-RP
+product INTEL XEOND_PCIE_NTB2ND	0x6f0f	Xeon-D PCIe Root Port NTB-secondary
 product INTEL XEOND_IIO_DEBUG_0	0x6f10	Xeon-D IIO Debug
 product INTEL XEOND_IIO_DEBUG_1	0x6f11	Xeon-D IIO Debug
 product INTEL XEOND_IIO_DEBUG_2	0x6f12	Xeon-D IIO Debug
@@ -5011,7 +5012,15 @@ product INTEL XEOND_IIO_DEBUG_12 0x6f1c	
 product INTEL XEOND_R2_0	0x6f1d	Xeon-D R2 PCIe Agent
 product INTEL XEOND_UBOX_0	0x6f1e	Core i7-6xxxK/Xeon-D Ubox
 product INTEL XEOND_UBOX_1	0x6f1f	Core i7-6xxxK/Xeon-D Ubox
-product INTEL XEOND_ADDRMAP	0x6f28	Core i7-6xxxK/Xeon-D IIO Address Map, VTD_Misc, System Management
+product INTEL XEONDNS_QD_0	0x6f20	Xeon-D NS QuickData DMA Channel 0
+product INTEL XEONDNS_QD_1	0x6f21	Xeon-D NS QuickData DMA Channel 1
+product INTEL XEONDNS_QD_2	0x6f22	Xeon-D NS QuickData DMA Channel 2
+product INTEL XEONDNS_QD_3	0x6f23	Xeon-D NS QuickData DMA Channel 3
+product INTEL XEONDNS_QD_4	0x6f24	Xeon-D NS QuickData DMA Channel 4
+product INTEL XEONDNS_QD_5	0x6f25	Xeon-D NS QuickData DMA Channel 5
+product INTEL XEONDNS_QD_6	0x6f26	Xeon-D NS QuickData DMA Channel 6
+product INTEL XEONDNS_QD_7	0x6f27	Xeon-D NS QuickData DMA Channel 7
+product INTEL XEONDNS_ADDRMAP	0x6f28	Core i7-6xxxK/Xeon-D IIO Address Map, VTD_Misc, System Management
 product INTEL XEOND_HOTPLUG	0x6f29	Xeon-D IIO Hot Plug
 product INTEL XEOND_RAS		0x6f2a	Core i7-6xxxK/Xeon-D IIO RAS, Control Status, Global Errors
 product INTEL XEOND_IOAPIC_2	0x6f2c	Core i7-6xxxK/Xeon-D I/O APIC



CVS commit: src/sys/dev/pci

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 03:45:54 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
- Add Xeon D-1500 NTB-secondary
- Add Xeon D NS QuickData DMA channel 0-7


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

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



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:21:03 UTC 2019

Modified Files:
src/sys/dev/mii: amhphy.c brgphy.c glxtphy.c gphyter.c ikphy.c

Log Message:
 Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/amhphy.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/mii/brgphy.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/glxtphy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/mii/ikphy.c

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

Modified files:

Index: src/sys/dev/mii/amhphy.c
diff -u src/sys/dev/mii/amhphy.c:1.23 src/sys/dev/mii/amhphy.c:1.24
--- src/sys/dev/mii/amhphy.c:1.23	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/amhphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: amhphy.c,v 1.23 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: amhphy.c,v 1.24 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.23 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.24 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -200,7 +200,7 @@ amhphy_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/brgphy.c
diff -u src/sys/dev/mii/brgphy.c:1.84 src/sys/dev/mii/brgphy.c:1.85
--- src/sys/dev/mii/brgphy.c:1.84	Thu Apr 11 08:50:20 2019
+++ src/sys/dev/mii/brgphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $	*/
+/*	$NetBSD: brgphy.c,v 1.85 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.85 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -491,7 +491,7 @@ brgphy_copper_status(struct mii_softc *s
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/glxtphy.c
diff -u src/sys/dev/mii/glxtphy.c:1.29 src/sys/dev/mii/glxtphy.c:1.30
--- src/sys/dev/mii/glxtphy.c:1.29	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/glxtphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: glxtphy.c,v 1.29 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: glxtphy.c,v 1.30 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.29 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.30 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -223,7 +223,7 @@ glxtphy_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((qsr & QSR_ACOMP) == 0) {

Index: src/sys/dev/mii/gphyter.c
diff -u src/sys/dev/mii/gphyter.c:1.34 src/sys/dev/mii/gphyter.c:1.35
--- src/sys/dev/mii/gphyter.c:1.34	Thu Nov 21 09:48:57 2019
+++ src/sys/dev/mii/gphyter.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $	*/
+/*	$NetBSD: gphyter.c,v 1.35 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.35 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -255,7 +255,7 @@ gphyter_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/ikphy.c
diff -u src/sys/dev/mii/ikphy.c:1.16 src/sys/dev/mii/ikphy.c:1.17
--- src/sys/dev/mii/ikphy.c:1.16	Wed Sep  4 06:28:30 2019
+++ src/sys/dev/mii/ikphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ikphy.c,v 1.16 2019/09/04 06:28:30 msaitoh Exp $	*/
+/*	$NetBSD: ikphy.c,v 1.17 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /***
 Copyright (c) 2001-2005, Intel Corporation 
@@ -59,7 +59,7 @@ POSSIBILITY OF SUCH 

CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:21:03 UTC 2019

Modified Files:
src/sys/dev/mii: amhphy.c brgphy.c glxtphy.c gphyter.c ikphy.c

Log Message:
 Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/amhphy.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/mii/brgphy.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/glxtphy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/mii/ikphy.c

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



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:19:51 UTC 2019

Modified Files:
src/sys/dev/mii: jmphy.c makphy.c qsphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/jmphy.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/qsphy.c

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



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:19:51 UTC 2019

Modified Files:
src/sys/dev/mii: jmphy.c makphy.c qsphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/jmphy.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/qsphy.c

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

Modified files:

Index: src/sys/dev/mii/jmphy.c
diff -u src/sys/dev/mii/jmphy.c:1.1 src/sys/dev/mii/jmphy.c:1.2
--- src/sys/dev/mii/jmphy.c:1.1	Wed Oct 30 12:06:26 2019
+++ src/sys/dev/mii/jmphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: jmphy.c,v 1.1 2019/10/30 12:06:26 msaitoh Exp $ */
+/*	$NetBSD: jmphy.c,v 1.2 2019/11/26 08:19:51 msaitoh Exp $ */
 /*	$OpenBSD: jmphy.c,v 1.6 2015/03/14 03:38:48 jsg Exp $	*/
 /*-
  * Copyright (c) 2008, Pyun YongHyeon 
@@ -127,9 +127,7 @@ jmphy_service(struct mii_softc *sc, stru
 
 	switch (cmd) {
 	case MII_POLLSTAT:
-		/*
-		 * If we're not polling our PHY instance, just return.
-		 */
+		/* If we're not polling our PHY instance, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 		break;
@@ -145,9 +143,7 @@ jmphy_service(struct mii_softc *sc, stru
 			return 0;
 		}
 
-		/*
-		 * If the interface is not up, don't do anything.
-		 */
+		/* If the interface is not up, don't do anything. */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			break;
 
@@ -156,21 +152,15 @@ jmphy_service(struct mii_softc *sc, stru
 		break;
 
 	case MII_TICK:
-		/*
-		 * If we're not currently selected, just return.
-		 */
+		/* If we're not currently selected, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 
-		/*
-		 * Is the interface even up?
-		 */
+		/* Is the interface even up? */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			return 0;
 
-		/*
-		 * Only used for autonegotiation.
-		 */
+		/* Only used for autonegotiation. */
 		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
 			break;
 

Index: src/sys/dev/mii/makphy.c
diff -u src/sys/dev/mii/makphy.c:1.60 src/sys/dev/mii/makphy.c:1.61
--- src/sys/dev/mii/makphy.c:1.60	Wed Jul  3 17:40:29 2019
+++ src/sys/dev/mii/makphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: makphy.c,v 1.60 2019/07/03 17:40:29 maxv Exp $	*/
+/*	$NetBSD: makphy.c,v 1.61 2019/11/26 08:19:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60 2019/07/03 17:40:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.61 2019/11/26 08:19:51 msaitoh Exp $");
 
 #include 
 #include 
@@ -240,9 +240,7 @@ makphy_reset(struct mii_softc *sc)
 
 	mii_phy_reset(sc);
 
-	/*
-	 * Initialize PHY Specific Control Register.
-	 */
+	/* Initialize PHY Specific Control Register. */
 	PHY_READ(sc, MAKPHY_PSCR, );
 
 	/* Assert CRS on transmit. */

Index: src/sys/dev/mii/qsphy.c
diff -u src/sys/dev/mii/qsphy.c:1.52 src/sys/dev/mii/qsphy.c:1.53
--- src/sys/dev/mii/qsphy.c:1.52	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/qsphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: qsphy.c,v 1.52 2019/03/25 09:20:46 msaitoh Exp $	*/
+/*	$NetBSD: qsphy.c,v 1.53 2019/11/26 08:19:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.52 2019/03/25 09:20:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.53 2019/11/26 08:19:51 msaitoh Exp $");
 
 #include 
 #include 
@@ -147,9 +147,7 @@ qsphy_service(struct mii_softc *sc, stru
 
 	switch (cmd) {
 	case MII_POLLSTAT:
-		/*
-		 * If we're not polling our PHY instance, just return.
-		 */
+		/* If we're not polling our PHY instance, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 		break;
@@ -165,9 +163,7 @@ qsphy_service(struct mii_softc *sc, stru
 			return 0;
 		}
 
-		/*
-		 * If the interface is not up, don't do anything.
-		 */
+		/* If the interface is not up, don't do anything. */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			break;
 
@@ -175,9 +171,7 @@ qsphy_service(struct mii_softc *sc, stru
 		break;
 
 	case MII_TICK:
-		/*
-		 * If we're not currently selected, just return.
-		 */
+		/* If we're not currently selected, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 



CVS commit: src/doc

2019-11-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 07:51:35 UTC 2019

Modified Files:
src/doc: CHANGES.prev

Log Message:
 Move notes about ipgphy(4), jmphy(4), smscphy(4), micphy(4) and alc(4)
from post 9.0 to pre 9.0.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/doc/CHANGES.prev

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.149 src/doc/CHANGES.prev:1.150
--- src/doc/CHANGES.prev:1.149	Tue Nov 12 08:35:56 2019
+++ src/doc/CHANGES.prev	Tue Nov 26 07:51:35 2019
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.149 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.150 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -12642,3 +12642,12 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[jmcneill 20190921]
 	evbarm: Add support for Amazon Graviton "a1.metal" instances.
 		[jmcneill 20191015]
+	ipgphy(4): Add support for IC Plus IP1000* PHY. [msaitoh 20191017]
+	alc(4): Add support for Killer E2400 and E2500. [msaitoh 20191017]
+	jmphy(4): Add support for JMicron JMP202 and JMP211 PHY.
+		[msaitoh 20191030]
+	smscphy(4): Add support for SMSC LAN87xx 10/100 Ethernet PHY.
+		[msaitoh 20191101]
+	micphy(4): Add support for Microchip KSZ80[0456]1, KSZ8721, KSZ9[01]31,
+		KS8731 and KSZ9477.
+		[msaitoh 20191107]



CVS commit: src/doc

2019-11-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 07:51:35 UTC 2019

Modified Files:
src/doc: CHANGES.prev

Log Message:
 Move notes about ipgphy(4), jmphy(4), smscphy(4), micphy(4) and alc(4)
from post 9.0 to pre 9.0.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/doc/CHANGES.prev

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



CVS commit: src/doc

2019-11-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 07:17:42 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
 Remove notes about ipgphy(4), jmphy(4), smscphy(4), micphy(4) and alc(4)
because those will be included in NetBSD 9.0.


To generate a diff of this commit:
cvs rdiff -u -r1.2615 -r1.2616 src/doc/CHANGES

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



CVS commit: src/doc

2019-11-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 07:17:42 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
 Remove notes about ipgphy(4), jmphy(4), smscphy(4), micphy(4) and alc(4)
because those will be included in NetBSD 9.0.


To generate a diff of this commit:
cvs rdiff -u -r1.2615 -r1.2616 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2615 src/doc/CHANGES:1.2616
--- src/doc/CHANGES:1.2615	Wed Nov 20 09:37:45 2019
+++ src/doc/CHANGES	Tue Nov 26 07:17:42 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2615 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2616 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -53,8 +53,6 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	sup: removed, use ftp://ftp.astron.com/pub/sup [christos 20191015]
 	dhcpcd(8): Import dhcpcd-8.1.1 [roy 20191016]
 	evbarm: Add support for the NanoPi R1 and Duo2. [bad 20191016]
-	ipgphy(4): Add support for IC Plus IP1000* PHY. [msaitoh 20191017]
-	alc(4): Add support for Killer E2400 and E2500. [msaitoh 20191017]
 	bind: Import version 9.14.7. [christos 20191017]
 	libc: Changed the iconv(3) function signature to the POSIX variation
 		[kamil 20191024]
@@ -63,17 +61,10 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		[ozaki-r 20191028]
 	evbarm: Update TI AM335x SoC support to use FDT based configuration.
 		[jmcneill 20191028]
-	jmphy(4): Add support for JMicron JMP202 and JMP211 PHY.
-		[msaitoh 20191030]
-	smscphy(4): Add support for SMSC LAN87xx 10/100 Ethernet PHY.
-		[msaitoh 20191101]
 	evbarm: Update TI OMAP3 SoC support to use FDT based configuration.
 		[jmcneill 20191101]
 	amd64: Add support for kCSan - Kernel Concurrency Sanitizer.
 		[maxv 20191105]
-	micphy(4): Add support for Microchip KSZ80[0456]1, KSZ8721, KSZ9[01]31,
-		KS8731 and KSZ9477.
-		[msaitoh 20191107]
 	tmux(1): Imported 2.9a. [christos 20191112]
 	dhcpcd(8): Import 8.1.2. [roy 20191113]
 	amd64: Add support for kMSan - Kernel Memory Sanitizer.



CVS commit: [netbsd-9] src/doc

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:52:54 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
 Ticket #466 and #471.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.116 -r1.1.2.117 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.116 src/doc/CHANGES-9.0:1.1.2.117
--- src/doc/CHANGES-9.0:1.1.2.116	Sun Nov 24 08:34:28 2019
+++ src/doc/CHANGES-9.0	Mon Nov 25 05:52:54 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.116 2019/11/24 08:34:28 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.117 2019/11/25 05:52:54 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -6247,3 +6247,64 @@ doc/3RDPARTY	1.1655 (patch)
 	Import tzdata2019c.
 	[kre, ticket #468]
 
+sys/arch/evbarm/beagle/beagle_machdep.c		1.80
+
+	Fix compile error when DIAGNOSTIC is not used.
+	[martin, ticket #466]
+
+distrib/notes/Makefile.inc			1.45
+distrib/notes/acorn32/contents			1.6
+distrib/notes/alpha/contents			1.20
+distrib/notes/amd64/contents			1.9
+distrib/notes/amiga/contents			1.24
+distrib/notes/arc/contents			1.6
+distrib/notes/arc/prep1.5
+distrib/notes/atari/contents			1.24
+distrib/notes/bebox/contents			1.6
+distrib/notes/cats/contents			1.6
+distrib/notes/cats/prep1.14
+distrib/notes/common/contents			1.180
+distrib/notes/common/main			1.554
+distrib/notes/common/postinstall		1.85
+distrib/notes/common/sysinst			1.109
+distrib/notes/common/upgrade			1.31
+distrib/notes/emips/contents			1.6
+distrib/notes/evbarm/contents			1.6
+distrib/notes/evbppc/contents			1.7
+distrib/notes/ews4800mips/contents		1.6
+distrib/notes/hp300/contents			1.21
+distrib/notes/hpcarm/contents			1.7
+distrib/notes/hpcmips/contents			1.14
+distrib/notes/hpcsh/contents			1.7
+distrib/notes/hppa/contents			1.6
+distrib/notes/i386/contents			1.33
+distrib/notes/landisk/contents			1.7
+distrib/notes/mac68k/contents			1.24
+distrib/notes/macppc/contents			1.18
+distrib/notes/macppc/prep.OPENFIRMWARE		1.21
+distrib/notes/mmeye/contents			1.7
+distrib/notes/mvme68k/contents			1.17
+distrib/notes/news68k/contents			1.10
+distrib/notes/newsmips/contents			1.6
+distrib/notes/next68k/contents			1.11
+distrib/notes/ofppc/contents			1.7
+distrib/notes/pmax/contents			1.21
+distrib/notes/prep/contents			1.6
+distrib/notes/rs6000/contents			1.6
+distrib/notes/sandpoint/contents		1.6
+distrib/notes/sandpoint/xfer			1.4
+distrib/notes/sgimips/contents			1.6
+distrib/notes/shark/contents			1.6
+distrib/notes/sparc/contents			1.25
+distrib/notes/sparc64/contents			1.9
+distrib/notes/sparc64/upgrade			1.7
+distrib/notes/sun2/contents			1.6
+distrib/notes/sun3/contents			1.20
+distrib/notes/vax/contents			1.15
+distrib/notes/x68k/contents			1.21
+
+	Modernize release notes:
+	 - Use https where possible.
+	 - Adapt to cdn/nycdn and our current auto-build conventions.
+	 - Automate where possible.
+	[martin, ticket #471]



CVS commit: [netbsd-9] src/doc

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:52:54 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
 Ticket #466 and #471.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.116 -r1.1.2.117 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/distrib/notes

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:50:21 UTC 2019

Modified Files:
src/distrib/notes [netbsd-9]: Makefile.inc
src/distrib/notes/acorn32 [netbsd-9]: contents
src/distrib/notes/alpha [netbsd-9]: contents
src/distrib/notes/amd64 [netbsd-9]: contents
src/distrib/notes/amiga [netbsd-9]: contents
src/distrib/notes/arc [netbsd-9]: contents prep
src/distrib/notes/atari [netbsd-9]: contents
src/distrib/notes/bebox [netbsd-9]: contents
src/distrib/notes/cats [netbsd-9]: contents prep
src/distrib/notes/common [netbsd-9]: contents main postinstall sysinst
upgrade
src/distrib/notes/emips [netbsd-9]: contents
src/distrib/notes/evbarm [netbsd-9]: contents
src/distrib/notes/evbppc [netbsd-9]: contents
src/distrib/notes/ews4800mips [netbsd-9]: contents
src/distrib/notes/hp300 [netbsd-9]: contents
src/distrib/notes/hpcarm [netbsd-9]: contents
src/distrib/notes/hpcmips [netbsd-9]: contents
src/distrib/notes/hpcsh [netbsd-9]: contents
src/distrib/notes/hppa [netbsd-9]: contents
src/distrib/notes/i386 [netbsd-9]: contents
src/distrib/notes/landisk [netbsd-9]: contents
src/distrib/notes/mac68k [netbsd-9]: contents
src/distrib/notes/macppc [netbsd-9]: contents prep.OPENFIRMWARE
src/distrib/notes/mmeye [netbsd-9]: contents
src/distrib/notes/mvme68k [netbsd-9]: contents
src/distrib/notes/news68k [netbsd-9]: contents
src/distrib/notes/newsmips [netbsd-9]: contents
src/distrib/notes/next68k [netbsd-9]: contents
src/distrib/notes/ofppc [netbsd-9]: contents
src/distrib/notes/pmax [netbsd-9]: contents
src/distrib/notes/prep [netbsd-9]: contents
src/distrib/notes/rs6000 [netbsd-9]: contents
src/distrib/notes/sandpoint [netbsd-9]: contents xfer
src/distrib/notes/sgimips [netbsd-9]: contents
src/distrib/notes/shark [netbsd-9]: contents
src/distrib/notes/sparc [netbsd-9]: contents
src/distrib/notes/sparc64 [netbsd-9]: contents upgrade
src/distrib/notes/sun2 [netbsd-9]: contents
src/distrib/notes/sun3 [netbsd-9]: contents
src/distrib/notes/vax [netbsd-9]: contents
src/distrib/notes/x68k [netbsd-9]: contents

Log Message:
Pull up following revision(s) (requested by martin in ticket #471):
distrib/notes/sandpoint/xfer: revision 1.4
distrib/notes/newsmips/contents: revision 1.6
distrib/notes/Makefile.inc: revision 1.45
distrib/notes/landisk/contents: revision 1.7
distrib/notes/sparc/contents: revision 1.25
distrib/notes/arc/contents: revision 1.6
distrib/notes/sun2/contents: revision 1.6
distrib/notes/common/sysinst: revision 1.109
distrib/notes/common/postinstall: revision 1.85
distrib/notes/vax/contents: revision 1.15
distrib/notes/mac68k/contents: revision 1.24
distrib/notes/alpha/contents: revision 1.20
distrib/notes/cats/contents: revision 1.6
distrib/notes/sparc64/contents: revision 1.9
distrib/notes/mvme68k/contents: revision 1.17
distrib/notes/i386/contents: revision 1.33
distrib/notes/common/main: revision 1.554
distrib/notes/rs6000/contents: revision 1.6
distrib/notes/hpcmips/contents: revision 1.14
distrib/notes/evbppc/contents: revision 1.7
distrib/notes/hpcarm/contents: revision 1.7
distrib/notes/emips/contents: revision 1.6
distrib/notes/sun3/contents: revision 1.20
distrib/notes/macppc/contents: revision 1.18
distrib/notes/amd64/contents: revision 1.9
distrib/notes/x68k/contents: revision 1.21
distrib/notes/sgimips/contents: revision 1.6
distrib/notes/sandpoint/contents: revision 1.6
distrib/notes/mmeye/contents: revision 1.7
distrib/notes/arc/prep: revision 1.5
distrib/notes/pmax/contents: revision 1.21
distrib/notes/shark/contents: revision 1.6
distrib/notes/news68k/contents: revision 1.10
distrib/notes/cats/prep: revision 1.14
distrib/notes/hp300/contents: revision 1.21
distrib/notes/common/upgrade: revision 1.31
distrib/notes/next68k/contents: revision 1.11
distrib/notes/amiga/contents: revision 1.24
distrib/notes/common/contents: revision 1.180
distrib/notes/evbarm/contents: revision 1.6
distrib/notes/sparc64/upgrade: revision 1.7
distrib/notes/hppa/contents: revision 1.6
distrib/notes/acorn32/contents: revision 1.6
distrib/notes/ofppc/contents: revision 1.7
distrib/notes/macppc/prep.OPENFIRMWARE: revision 1.21
distrib/notes/atari/contents: revision 1.24
distrib/notes/bebox/contents: revision 1.6
distrib/notes/prep/contents: revision 1.6
distrib/notes/hpcsh/contents: 

CVS commit: [netbsd-9] src/distrib/notes

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:50:21 UTC 2019

Modified Files:
src/distrib/notes [netbsd-9]: Makefile.inc
src/distrib/notes/acorn32 [netbsd-9]: contents
src/distrib/notes/alpha [netbsd-9]: contents
src/distrib/notes/amd64 [netbsd-9]: contents
src/distrib/notes/amiga [netbsd-9]: contents
src/distrib/notes/arc [netbsd-9]: contents prep
src/distrib/notes/atari [netbsd-9]: contents
src/distrib/notes/bebox [netbsd-9]: contents
src/distrib/notes/cats [netbsd-9]: contents prep
src/distrib/notes/common [netbsd-9]: contents main postinstall sysinst
upgrade
src/distrib/notes/emips [netbsd-9]: contents
src/distrib/notes/evbarm [netbsd-9]: contents
src/distrib/notes/evbppc [netbsd-9]: contents
src/distrib/notes/ews4800mips [netbsd-9]: contents
src/distrib/notes/hp300 [netbsd-9]: contents
src/distrib/notes/hpcarm [netbsd-9]: contents
src/distrib/notes/hpcmips [netbsd-9]: contents
src/distrib/notes/hpcsh [netbsd-9]: contents
src/distrib/notes/hppa [netbsd-9]: contents
src/distrib/notes/i386 [netbsd-9]: contents
src/distrib/notes/landisk [netbsd-9]: contents
src/distrib/notes/mac68k [netbsd-9]: contents
src/distrib/notes/macppc [netbsd-9]: contents prep.OPENFIRMWARE
src/distrib/notes/mmeye [netbsd-9]: contents
src/distrib/notes/mvme68k [netbsd-9]: contents
src/distrib/notes/news68k [netbsd-9]: contents
src/distrib/notes/newsmips [netbsd-9]: contents
src/distrib/notes/next68k [netbsd-9]: contents
src/distrib/notes/ofppc [netbsd-9]: contents
src/distrib/notes/pmax [netbsd-9]: contents
src/distrib/notes/prep [netbsd-9]: contents
src/distrib/notes/rs6000 [netbsd-9]: contents
src/distrib/notes/sandpoint [netbsd-9]: contents xfer
src/distrib/notes/sgimips [netbsd-9]: contents
src/distrib/notes/shark [netbsd-9]: contents
src/distrib/notes/sparc [netbsd-9]: contents
src/distrib/notes/sparc64 [netbsd-9]: contents upgrade
src/distrib/notes/sun2 [netbsd-9]: contents
src/distrib/notes/sun3 [netbsd-9]: contents
src/distrib/notes/vax [netbsd-9]: contents
src/distrib/notes/x68k [netbsd-9]: contents

Log Message:
Pull up following revision(s) (requested by martin in ticket #471):
distrib/notes/sandpoint/xfer: revision 1.4
distrib/notes/newsmips/contents: revision 1.6
distrib/notes/Makefile.inc: revision 1.45
distrib/notes/landisk/contents: revision 1.7
distrib/notes/sparc/contents: revision 1.25
distrib/notes/arc/contents: revision 1.6
distrib/notes/sun2/contents: revision 1.6
distrib/notes/common/sysinst: revision 1.109
distrib/notes/common/postinstall: revision 1.85
distrib/notes/vax/contents: revision 1.15
distrib/notes/mac68k/contents: revision 1.24
distrib/notes/alpha/contents: revision 1.20
distrib/notes/cats/contents: revision 1.6
distrib/notes/sparc64/contents: revision 1.9
distrib/notes/mvme68k/contents: revision 1.17
distrib/notes/i386/contents: revision 1.33
distrib/notes/common/main: revision 1.554
distrib/notes/rs6000/contents: revision 1.6
distrib/notes/hpcmips/contents: revision 1.14
distrib/notes/evbppc/contents: revision 1.7
distrib/notes/hpcarm/contents: revision 1.7
distrib/notes/emips/contents: revision 1.6
distrib/notes/sun3/contents: revision 1.20
distrib/notes/macppc/contents: revision 1.18
distrib/notes/amd64/contents: revision 1.9
distrib/notes/x68k/contents: revision 1.21
distrib/notes/sgimips/contents: revision 1.6
distrib/notes/sandpoint/contents: revision 1.6
distrib/notes/mmeye/contents: revision 1.7
distrib/notes/arc/prep: revision 1.5
distrib/notes/pmax/contents: revision 1.21
distrib/notes/shark/contents: revision 1.6
distrib/notes/news68k/contents: revision 1.10
distrib/notes/cats/prep: revision 1.14
distrib/notes/hp300/contents: revision 1.21
distrib/notes/common/upgrade: revision 1.31
distrib/notes/next68k/contents: revision 1.11
distrib/notes/amiga/contents: revision 1.24
distrib/notes/common/contents: revision 1.180
distrib/notes/evbarm/contents: revision 1.6
distrib/notes/sparc64/upgrade: revision 1.7
distrib/notes/hppa/contents: revision 1.6
distrib/notes/acorn32/contents: revision 1.6
distrib/notes/ofppc/contents: revision 1.7
distrib/notes/macppc/prep.OPENFIRMWARE: revision 1.21
distrib/notes/atari/contents: revision 1.24
distrib/notes/bebox/contents: revision 1.6
distrib/notes/prep/contents: revision 1.6
distrib/notes/hpcsh/contents: 

CVS commit: [netbsd-9] src/sys/arch/evbarm/beagle

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:47:13 UTC 2019

Modified Files:
src/sys/arch/evbarm/beagle [netbsd-9]: beagle_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #466):
sys/arch/evbarm/beagle/beagle_machdep.c: revision 1.80
"rv" is only used on some boards and only with options DIAGNOSTIC.
So move the declaration into the proper #ifdef block.


To generate a diff of this commit:
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 \
src/sys/arch/evbarm/beagle/beagle_machdep.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/arch/evbarm/beagle/beagle_machdep.c
diff -u src/sys/arch/evbarm/beagle/beagle_machdep.c:1.78.2.1 src/sys/arch/evbarm/beagle/beagle_machdep.c:1.78.2.2
--- src/sys/arch/evbarm/beagle/beagle_machdep.c:1.78.2.1	Fri Nov 22 15:28:18 2019
+++ src/sys/arch/evbarm/beagle/beagle_machdep.c	Mon Nov 25 05:47:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: beagle_machdep.c,v 1.78.2.1 2019/11/22 15:28:18 bouyer Exp $ */
+/*	$NetBSD: beagle_machdep.c,v 1.78.2.2 2019/11/25 05:47:13 msaitoh Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.78.2.1 2019/11/22 15:28:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.78.2.2 2019/11/25 05:47:13 msaitoh Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -1075,7 +1075,6 @@ void
 beagle_device_register(device_t self, void *aux)
 {
 	prop_dictionary_t dict = device_properties(self);
-	int rv __diagused;
 
 	if (device_is_a(self, "armperiph")
 	&& device_is_a(device_parent(self), "mainbus")) {
@@ -1170,6 +1169,7 @@ beagle_device_register(device_t self, vo
 		prop_dictionary_set_int16(dict, "port2-gpio", -1);
 #endif
 #if defined(OMAP_5430)
+		int rv __diagused;
 		bus_space_tag_t iot = _bs_tag;
 		bus_space_handle_t ioh;
 		omap2_gpio_ctl(80, GPIO_PIN_OUTPUT);



CVS commit: [netbsd-9] src/sys/arch/evbarm/beagle

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:47:13 UTC 2019

Modified Files:
src/sys/arch/evbarm/beagle [netbsd-9]: beagle_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #466):
sys/arch/evbarm/beagle/beagle_machdep.c: revision 1.80
"rv" is only used on some boards and only with options DIAGNOSTIC.
So move the declaration into the proper #ifdef block.


To generate a diff of this commit:
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 \
src/sys/arch/evbarm/beagle/beagle_machdep.c

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



CVS commit: src/sys/dev/pci

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:35:26 UTC 2019

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
 Modify PHY initialization code. This change fix a bug that SK-9D21 doesn't
detect MII PHY.
 - Add error check to bge_miibus_writereg().
 - Change return value of bge_miibus_readreg() when a read error occurred.
   It also add error message using with aprint_debug_dev(). This error occurs
   on some devices while detecting MII devices.
 - Move the location of BGE_MI_MODE register's initialization to next to
   bge_chipinit().
 - Set BGE_MAC_MODE before calling ifmedia_init() and/or mii_attach().
 - Add retry code for mii_attach() failed. Same as FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.341 -r1.342 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.



CVS commit: src/sys/dev/pci

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:35:26 UTC 2019

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
 Modify PHY initialization code. This change fix a bug that SK-9D21 doesn't
detect MII PHY.
 - Add error check to bge_miibus_writereg().
 - Change return value of bge_miibus_readreg() when a read error occurred.
   It also add error message using with aprint_debug_dev(). This error occurs
   on some devices while detecting MII devices.
 - Move the location of BGE_MI_MODE register's initialization to next to
   bge_chipinit().
 - Set BGE_MAC_MODE before calling ifmedia_init() and/or mii_attach().
 - Add retry code for mii_attach() failed. Same as FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.341 -r1.342 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.341 src/sys/dev/pci/if_bge.c:1.342
--- src/sys/dev/pci/if_bge.c:1.341	Mon Nov 25 05:18:59 2019
+++ src/sys/dev/pci/if_bge.c	Mon Nov 25 05:35:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.341 2019/11/25 05:18:59 msaitoh Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.342 2019/11/25 05:35:26 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.341 2019/11/25 05:18:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.342 2019/11/25 05:35:26 msaitoh Exp $");
 
 #include 
 #include 
@@ -1113,9 +1113,11 @@ bge_miibus_readreg(device_t dev, int phy
 	if (i == BGE_TIMEOUT) {
 		aprint_error_dev(sc->bge_dev, "PHY read timed out\n");
 		rv = ETIMEDOUT;
-	} else if ((data & BGE_MICOMM_READFAIL) != 0)
-		rv = -1;
-	else
+	} else if ((data & BGE_MICOMM_READFAIL) != 0) {
+		/* XXX This error occurs on some devices while attaching. */
+		aprint_debug_dev(sc->bge_dev, "PHY read I/O error\n");
+		rv = EIO;
+	} else
 		*val = data & BGE_MICOMM_DATA;
 
 	if (autopoll & BGE_MIMODE_AUTOPOLL) {
@@ -1133,7 +1135,8 @@ static int
 bge_miibus_writereg(device_t dev, int phy, int reg, uint16_t val)
 {
 	struct bge_softc *sc = device_private(dev);
-	uint32_t autopoll;
+	uint32_t data, autopoll;
+	int rv = 0;
 	int i;
 
 	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906 &&
@@ -1156,13 +1159,22 @@ bge_miibus_writereg(device_t dev, int ph
 
 	for (i = 0; i < BGE_TIMEOUT; i++) {
 		delay(10);
-		if (!(CSR_READ_4(sc, BGE_MI_COMM) & BGE_MICOMM_BUSY)) {
+		data = CSR_READ_4(sc, BGE_MI_COMM);
+		if (!(data & BGE_MICOMM_BUSY)) {
 			delay(5);
-			CSR_READ_4(sc, BGE_MI_COMM);
+			data = CSR_READ_4(sc, BGE_MI_COMM);
 			break;
 		}
 	}
 
+	if (i == BGE_TIMEOUT) {
+		aprint_error_dev(sc->bge_dev, "PHY write timed out\n");
+		rv = ETIMEDOUT;
+	} else if ((data & BGE_MICOMM_READFAIL) != 0) {
+		aprint_error_dev(sc->bge_dev, "PHY write I/O error\n");
+		rv = EIO;
+	}
+
 	if (autopoll & BGE_MIMODE_AUTOPOLL) {
 		BGE_STS_SETBIT(sc, BGE_STS_AUTOPOLL);
 		BGE_SETBIT_FLUSH(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL);
@@ -1176,7 +1188,7 @@ bge_miibus_writereg(device_t dev, int ph
 		return ETIMEDOUT;
 	}
 
-	return 0;
+	return rv;
 }
 
 static void
@@ -3176,14 +3188,14 @@ bge_attach(device_t parent, device_t sel
 	uint32_t		command;
 	struct ifnet		*ifp;
 	struct mii_data * const mii = >bge_mii;
-	uint32_t		misccfg, mimode;
+	uint32_t		misccfg, mimode, macmode;
 	void *			kva;
 	u_char			eaddr[ETHER_ADDR_LEN];
 	pcireg_t		memtype, subid, reg;
 	bus_addr_t		memaddr;
 	uint32_t		pm_ctl;
 	bool			no_seeprom;
-	int			capmask;
+	int			capmask, trys;
 	int			mii_flags;
 	int			map_flags;
 	char intrbuf[PCI_INTRSTR_LEN];
@@ -3427,15 +3439,6 @@ bge_attach(device_t parent, device_t sel
 	BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
 		sc->bge_flags |= BGEF_CPMU_PRESENT;
 
-	/* Set MI_MODE */
-	mimode = BGE_MIMODE_PHYADDR(sc->bge_phy_addr);
-	if ((sc->bge_flags & BGEF_CPMU_PRESENT) != 0)
-		mimode |= BGE_MIMODE_500KHZ_CONST;
-	else
-		mimode |= BGE_MIMODE_BASE;
-	CSR_WRITE_4(sc, BGE_MI_MODE, mimode);
-	DELAY(80);
-
 	/*
 	 * When using the BCM5701 in PCI-X mode, data corruption has
 	 * been observed in the first few bytes of some received packets.
@@ -3680,6 +3683,21 @@ bge_attach(device_t parent, device_t sel
 		return;
 	}
 
+	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5700) {
+		BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL,
+		BGE_MLC_MISCIO_OUT1 | BGE_MLC_MISCIO_OUTEN1);
+		DELAY(100);
+	}
+
+	/* Set MI_MODE */
+	mimode = BGE_MIMODE_PHYADDR(sc->bge_phy_addr);
+	if ((sc->bge_flags & BGEF_CPMU_PRESENT) != 0)
+		mimode |= BGE_MIMODE_500KHZ_CONST;
+	else
+		mimode |= BGE_MIMODE_BASE;
+	CSR_WRITE_4_FLUSH(sc, BGE_MI_MODE, mimode);
+	DELAY(80);
+
 	/*
 	 * Get station address from the EEPROM.
 	 */
@@ -3866,8 +3884,14 @@ bge_attach(device_t parent, device_t sel
 	prop_dictionary_set_uint32(dict, "phyflags", sc->bge_phy_flags);
 	prop_dictionary_set_uint32(dict, "chipid", 

CVS commit: src/sys/dev/pci

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:18:59 UTC 2019

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
- Use *_FLUSH() more. The main purpose is to wait following delay() correctly.
- Add missing DELAY(80) after writing BGE_MI_MODE register.


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 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.340 src/sys/dev/pci/if_bge.c:1.341
--- src/sys/dev/pci/if_bge.c:1.340	Mon Nov 25 04:52:27 2019
+++ src/sys/dev/pci/if_bge.c	Mon Nov 25 05:18:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.340 2019/11/25 04:52:27 msaitoh Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.341 2019/11/25 05:18:59 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.340 2019/11/25 04:52:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.341 2019/11/25 05:18:59 msaitoh Exp $");
 
 #include 
 #include 
@@ -1027,10 +1027,10 @@ bge_eeprom_getbyte(struct bge_softc *sc,
 	 * Enable use of auto EEPROM access so we can avoid
 	 * having to use the bitbang method.
 	 */
-	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
+	BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
 
 	/* Reset the EEPROM, load the clock period. */
-	CSR_WRITE_4(sc, BGE_EE_ADDR,
+	CSR_WRITE_4_FLUSH(sc, BGE_EE_ADDR,
 	BGE_EEADDR_RESET | BGE_EEHALFCLK(BGE_HALFCLK_384SCL));
 	DELAY(20);
 
@@ -2280,7 +2280,7 @@ bge_chipinit(struct bge_softc *sc)
 #endif
 
 	/* Set the timer prescaler (always 66MHz) */
-	CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
+	CSR_WRITE_4_FLUSH(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
 
 	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) {
 		DELAY(40);	/* XXX */
@@ -3434,6 +3434,7 @@ bge_attach(device_t parent, device_t sel
 	else
 		mimode |= BGE_MIMODE_BASE;
 	CSR_WRITE_4(sc, BGE_MI_MODE, mimode);
+	DELAY(80);
 
 	/*
 	 * When using the BCM5701 in PCI-X mode, data corruption has
@@ -3630,10 +3631,10 @@ bge_attach(device_t parent, device_t sel
 	 * Reset NVRAM before bge_reset(). It's required to acquire NVRAM
 	 * lock in bge_reset().
 	 */
-	CSR_WRITE_4(sc, BGE_EE_ADDR,
+	CSR_WRITE_4_FLUSH(sc, BGE_EE_ADDR,
 	BGE_EEADDR_RESET | BGE_EEHALFCLK(BGE_HALFCLK_384SCL));
 	delay(1000);
-	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
+	BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
 
 	bge_stop_fw(sc);
 	bge_sig_pre_reset(sc, BGE_RESET_START);
@@ -5670,10 +5671,10 @@ bge_ifmedia_upd(struct ifnet *ifp)
 			break;
 		case IFM_1000_SX:
 			if ((ifm->ifm_media & IFM_FDX) != 0) {
-BGE_CLRBIT(sc, BGE_MAC_MODE,
+BGE_CLRBIT_FLUSH(sc, BGE_MAC_MODE,
 BGE_MACMODE_HALF_DUPLEX);
 			} else {
-BGE_SETBIT(sc, BGE_MAC_MODE,
+BGE_SETBIT_FLUSH(sc, BGE_MAC_MODE,
 BGE_MACMODE_HALF_DUPLEX);
 			}
 			DELAY(40);
@@ -6071,7 +6072,7 @@ bge_link_upd(struct bge_softc *sc)
 BGE_STS_SETBIT(sc, BGE_STS_LINK);
 if (BGE_ASICREV(sc->bge_chipid)
 == BGE_ASICREV_BCM5704) {
-	BGE_CLRBIT(sc, BGE_MAC_MODE,
+	BGE_CLRBIT_FLUSH(sc, BGE_MAC_MODE,
 	BGE_MACMODE_TBI_SEND_CFGS);
 	DELAY(40);
 }



CVS commit: src/sys/dev/pci

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 05:18:59 UTC 2019

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
- Use *_FLUSH() more. The main purpose is to wait following delay() correctly.
- Add missing DELAY(80) after writing BGE_MI_MODE register.


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 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.



CVS commit: src/sys/dev/pci

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 04:52:27 UTC 2019

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
 Fix a bug that SK-9D41 can't detect fiber media. Check the subsystem ID
correctly. This bug was added in if_bge.c rev. 1.161.


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 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.



CVS commit: src/sys/dev/pci

2019-11-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 25 04:52:27 UTC 2019

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
 Fix a bug that SK-9D41 can't detect fiber media. Check the subsystem ID
correctly. This bug was added in if_bge.c rev. 1.161.


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 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.339 src/sys/dev/pci/if_bge.c:1.340
--- src/sys/dev/pci/if_bge.c:1.339	Sun Nov 10 21:16:36 2019
+++ src/sys/dev/pci/if_bge.c	Mon Nov 25 04:52:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.339 2019/11/10 21:16:36 chs Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.340 2019/11/25 04:52:27 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.339 2019/11/10 21:16:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.340 2019/11/25 04:52:27 msaitoh Exp $");
 
 #include 
 #include 
@@ -3847,7 +3847,7 @@ bge_attach(device_t parent, device_t sel
 	 * by its PCI subsystem ID, as we do below for the SysKonnect SK-9D41.
 	 * The SysKonnect SK-9D41 is a 1000baseSX card.
 	 */
-	if (PCI_PRODUCT(pa->pa_id) == SK_SUBSYSID_9D41 ||
+	if (PCI_PRODUCT(subid) == SK_SUBSYSID_9D41 ||
 	(hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) {
 		if (BGE_IS_5705_PLUS(sc)) {
 			sc->bge_flags |= BGEF_FIBER_MII;



CVS commit: src/sys/dev/mii

2019-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 09:48:57 UTC 2019

Modified Files:
src/sys/dev/mii: gphyter.c ipgphy.c

Log Message:
 Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/ipgphy.c

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

Modified files:

Index: src/sys/dev/mii/gphyter.c
diff -u src/sys/dev/mii/gphyter.c:1.33 src/sys/dev/mii/gphyter.c:1.34
--- src/sys/dev/mii/gphyter.c:1.33	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/gphyter.c	Thu Nov 21 09:48:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gphyter.c,v 1.33 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.33 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $");
 
 #include 
 #include 
@@ -264,7 +264,7 @@ gphyter_status(struct mii_softc *sc)
 			return;
 		}
 
-		switch (physup & (PHY_SUP_SPEED1|PHY_SUP_SPEED0)) {
+		switch (physup & (PHY_SUP_SPEED1 | PHY_SUP_SPEED0)) {
 		case PHY_SUP_SPEED1:
 			mii->mii_media_active |= IFM_1000_T;
 			PHY_READ(sc, MII_100T2SR, );

Index: src/sys/dev/mii/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.5 src/sys/dev/mii/ipgphy.c:1.6
--- src/sys/dev/mii/ipgphy.c:1.5	Thu Nov 21 03:04:21 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 21 09:48:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipgphy.c,v 1.5 2019/11/21 03:04:21 msaitoh Exp $ */
+/*	$NetBSD: ipgphy.c,v 1.6 2019/11/21 09:48:57 msaitoh Exp $ */
 /*	$OpenBSD: ipgphy.c,v 1.19 2015/07/19 06:28:12 yuo Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.5 2019/11/21 03:04:21 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.6 2019/11/21 09:48:57 msaitoh Exp $");
 
 #include 
 #include 
@@ -118,7 +118,7 @@ ipgphy_attach(device_t parent, device_t 
 	//sc->mii_capabilities &= ~BMSR_ANEG;
 	if (sc->mii_capabilities & BMSR_EXTSTAT)
 		PHY_READ(sc, MII_EXTSR, >mii_extcapabilities);
- 
+
 	mii_phy_add_media(sc);
 	aprint_normal("\n");
 }
@@ -256,7 +256,7 @@ ipgphy_status(struct mii_softc *sc)
 
 	PHY_READ(sc, MII_BMSR, );
 	PHY_READ(sc, MII_BMSR, );
-	if (bmsr & BMSR_LINK) 
+	if (bmsr & BMSR_LINK)
 		mii->mii_media_status |= IFM_ACTIVE;
 
 	PHY_READ(sc, MII_BMCR, );



CVS commit: src/sys/dev/mii

2019-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 09:48:57 UTC 2019

Modified Files:
src/sys/dev/mii: gphyter.c ipgphy.c

Log Message:
 Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/ipgphy.c

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



CVS commit: src/sys/dev/pci

2019-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 09:18:17 UTC 2019

Modified Files:
src/sys/dev/pci: if_ale.c

Log Message:
 Remove accidentally committed debug code. Sorry.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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.



CVS commit: src/sys/dev/pci

2019-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 09:18:17 UTC 2019

Modified Files:
src/sys/dev/pci: if_ale.c

Log Message:
 Remove accidentally committed debug code. Sorry.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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.35 src/sys/dev/pci/if_ale.c:1.36
--- src/sys/dev/pci/if_ale.c:1.35	Thu Nov 21 09:12:30 2019
+++ src/sys/dev/pci/if_ale.c	Thu Nov 21 09:18:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ale.c,v 1.35 2019/11/21 09:12:30 msaitoh Exp $	*/
+/*	$NetBSD: if_ale.c,v 1.36 2019/11/21 09:18:16 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon 
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.35 2019/11/21 09:12:30 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.36 2019/11/21 09:18:16 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -136,9 +136,10 @@ ale_miibus_readreg(device_t dev, int phy
 	if (phy != sc->ale_phyaddr)
 		return -1;
 
-#if 1
 	if (sc->ale_flags & ALE_FLAG_FASTETHER) {
 		switch (reg) {
+		case MII_100T2CR:
+		case MII_100T2SR:
 		case MII_EXTSR:
 			*val = 0;
 			return 0;
@@ -146,7 +147,6 @@ ale_miibus_readreg(device_t dev, int phy
 			break;
 		}
 	}
-#endif
 
 	CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ |
 	MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg));
@@ -177,23 +177,19 @@ ale_miibus_writereg(device_t dev, int ph
 	if (phy != sc->ale_phyaddr)
 		return -1;
 
-#if 1
 	if (sc->ale_flags & ALE_FLAG_FASTETHER) {
-#if 0
 		switch (reg) {
+		case MII_100T2CR:
+		case MII_100T2SR:
 		case MII_EXTSR:
-			printf("%s:  write EXTSR with %04hx\n", __func__,
-val);
 			return 0;
 		default:
 			break;
 		}
-#endif
 	}
-#endif
 
 	CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE |
-		((uint32_t)val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT |
+	(val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT |
 	MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg));
 	for (i = ALE_PHY_TIMEOUT; i > 0; i--) {
 		DELAY(5);
@@ -259,9 +255,6 @@ ale_mediastatus(struct ifnet *ifp, struc
 	struct ale_softc *sc = ifp->if_softc;
 	struct mii_data *mii = >sc_miibus;
 
-	if ((ifp->if_flags & IFF_UP) == 0)
-		return;
-
 	mii_pollstat(mii);
 	ifmr->ifm_status = mii->mii_media_status;
 	ifmr->ifm_active = mii->mii_media_active;
@@ -274,7 +267,6 @@ ale_mediachange(struct ifnet *ifp)
 	struct mii_data *mii = >sc_miibus;
 	int error;
 
-	printf("%s: called\n", __func__);
 	if (mii->mii_instance != 0) {
 		struct mii_softc *miisc;
 
@@ -343,20 +335,16 @@ ale_get_macaddr(struct ale_softc *sc)
 void
 ale_phy_reset(struct ale_softc *sc)
 {
-//	int error;
-
-	printf("%s: called\n", __func__);
 	/* Reset magic from Linux. */
 	CSR_WRITE_2(sc, ALE_GPHY_CTRL,
 	GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE | GPHY_CTRL_SEL_ANA_RESET |
 	GPHY_CTRL_PHY_PLL_ON);
-	DELAY(2000);
+	DELAY(1000);
 	CSR_WRITE_2(sc, ALE_GPHY_CTRL,
 	GPHY_CTRL_EXT_RESET | GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE |
 	GPHY_CTRL_SEL_ANA_RESET | GPHY_CTRL_PHY_PLL_ON);
-	DELAY(2000);
+	DELAY(1000);
 
-#define	ATPHY_INT_CTRL		0x12
 #define	ATPHY_DBG_ADDR		0x1D
 #define	ATPHY_DBG_DATA		0x1E
 
@@ -386,10 +374,9 @@ ale_phy_reset(struct ale_softc *sc)
 	ale_miibus_writereg(sc->sc_dev, sc->ale_phyaddr,
 	ATPHY_DBG_DATA, 0x2C46);
 
-	DELAY(1000);
-
 #undef	ATPHY_DBG_ADDR
 #undef	ATPHY_DBG_DATA
+	DELAY(1000);
 }
 
 void
@@ -402,7 +389,7 @@ ale_attach(device_t parent, device_t sel
 	const char *intrstr;
 	struct ifnet *ifp;
 	struct mii_data * const mii = >sc_miibus;
-	pcireg_t memtype, pcireg, capoff;
+	pcireg_t memtype;
 	int mii_flags, error = 0;
 	uint32_t rxf_len, txf_len;
 	const char *chipname;
@@ -436,26 +423,6 @@ ale_attach(device_t parent, device_t sel
 		return;
 	}
 
-	pcireg = pci_conf_read(sc->sc_pct, sc->sc_pcitag,
-	PCI_COMMAND_STATUS_REG);
-	printf("%s: command = %08x\n", __func__, pcireg);
-	pcireg |= PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE;
-	pci_conf_write(sc->sc_pct, sc->sc_pcitag, PCI_COMMAND_STATUS_REG, pcireg);
-
-#if 1
-	if (pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_PWRMGMT, ,
-	NULL) != 0) {
-		pcireg = pci_conf_read(pa->pa_pc, pa->pa_tag,
-		PCI_COMMAND_STATUS_REG);
-		printf("%s: CSR was %#08x\n", __func__, pcireg);
-		pcireg = pci_conf_read(pa->pa_pc, pa->pa_tag,
-		capoff + PCI_PMCSR);
-		printf("%s: PMCSR was %#08x\n", __func__, pcireg);
-		pci_conf_write(pa->pa_pc, pa->pa_tag, capoff + PCI_PMCSR, 0);
-		delay(1000);
-	}
-#endif
-
 	if (pci_intr_map(pa, ) != 0) {
 		aprint_error_dev(self, "could not map interrupt\n");
 		goto fail;
@@ -479,6 +446,11 @@ ale_attach(device_t parent, device_t sel
 	sc->ale_phyaddr = ALE_PHY_ADDR;
 
 	/* Reset PHY. */
+	ale_phy_reset(sc);
+
+	/* Reset the ethernet 

CVS commit: src/sys/dev/pci

2019-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 09:12:30 UTC 2019

Modified Files:
src/sys/dev/pci: if_age.c if_alc.c if_ale.c if_cas.c

Log Message:
Fix a bug that IFF_ALLMULTI is almost always set.

 OpenBSD's ac_multirangecnt is not NetBSD's ec_multicnt.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/if_age.c
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_ale.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_cas.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.63 src/sys/dev/pci/if_age.c:1.64
--- src/sys/dev/pci/if_age.c:1.63	Thu Nov 21 06:22:09 2019
+++ src/sys/dev/pci/if_age.c	Thu Nov 21 09:12:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.63 2019/11/21 06:22:09 msaitoh Exp $ */
+/*	$NetBSD: if_age.c,v 1.64 2019/11/21 09:12:30 msaitoh 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 
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.63 2019/11/21 06:22:09 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.64 2019/11/21 09:12:30 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -2275,27 +2275,37 @@ age_rxfilter(struct age_softc *sc)
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
+	/* Program new filter. */
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
+		goto update;
+
+	memset(mchash, 0, sizeof(mchash));
+
+	ETHER_LOCK(ec);
+	ETHER_FIRST_MULTI(step, ec, enm);
+	while (enm != NULL) {
+		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+			ETHER_UNLOCK(ec);
+			goto update;
+		}
+		crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
+		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+		ETHER_NEXT_MULTI(step, enm);
+	}
+	ETHER_UNLOCK(ec);
+
+update:
+	if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+		if (ifp->if_flags & IFF_PROMISC) {
 			rxcfg |= MAC_CFG_PROMISC;
-		else
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+		} else
 			rxcfg |= MAC_CFG_ALLMULTI;
 		mchash[0] = mchash[1] = 0x;
-	} else {
-		/* Program new filter. */
-		memset(mchash, 0, sizeof(mchash));
-
-		ETHER_LOCK(ec);
-		ETHER_FIRST_MULTI(step, ec, enm);
-		while (enm != NULL) {
-			crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
-			mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
-			ETHER_NEXT_MULTI(step, enm);
-		}
-		ETHER_UNLOCK(ec);
 	}
-
 	CSR_WRITE_4(sc, AGE_MAR0, mchash[0]);
 	CSR_WRITE_4(sc, AGE_MAR1, mchash[1]);
 	CSR_WRITE_4(sc, AGE_MAC_CFG, rxcfg);

Index: src/sys/dev/pci/if_alc.c
diff -u src/sys/dev/pci/if_alc.c:1.43 src/sys/dev/pci/if_alc.c:1.44
--- src/sys/dev/pci/if_alc.c:1.43	Wed Oct 30 07:26:28 2019
+++ src/sys/dev/pci/if_alc.c	Thu Nov 21 09:12:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_alc.c,v 1.43 2019/10/30 07:26:28 msaitoh Exp $	*/
+/*	$NetBSD: if_alc.c,v 1.44 2019/11/21 09:12:30 msaitoh Exp $	*/
 /*	$OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $	*/
 /*-
  * Copyright (c) 2009, Pyun YongHyeon 
@@ -3443,27 +3443,37 @@ alc_iff(struct alc_softc *sc)
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
+	/* Program new filter. */
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
+		goto update;
+
+	memset(mchash, 0, sizeof(mchash));
+
+	ETHER_LOCK(ec);
+	ETHER_FIRST_MULTI(step, ec, enm);
+	while (enm != NULL) {
+		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+			ETHER_UNLOCK(ec);
+			goto update;
+		}
+		crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
+		mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+		ETHER_NEXT_MULTI(step, enm);
+	}
+	ETHER_UNLOCK(ec);
+
+update:
+	if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+		if (ifp->if_flags & IFF_PROMISC) {
 			rxcfg |= MAC_CFG_PROMISC;
-		else
+			/* XXX Use ETHER_F_ALLMULTI in future. */
+			ifp->if_flags |= IFF_ALLMULTI;
+		} else
 			rxcfg |= MAC_CFG_ALLMULTI;
 		mchash[0] = mchash[1] = 0x;
-	} else {
-		/* Program new filter. */
-		memset(mchash, 0, sizeof(mchash));
-
-		ETHER_LOCK(ec);
-		ETHER_FIRST_MULTI(step, ec, enm);
-		while (enm != NULL) {
-			crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
-			mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
-			ETHER_NEXT_MULTI(step, enm);
-		}
-		ETHER_UNLOCK(ec);
 	}
-
 	CSR_WRITE_4(sc, ALC_MAR0, mchash[0]);
 	CSR_WRITE_4(sc, ALC_MAR1, mchash[1]);
 	CSR_WRITE_4(sc, ALC_MAC_CFG, rxcfg);

Index: src/sys/dev/pci/if_ale.c
diff -u 

CVS commit: src/sys/dev/pci

2019-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 09:12:30 UTC 2019

Modified Files:
src/sys/dev/pci: if_age.c if_alc.c if_ale.c if_cas.c

Log Message:
Fix a bug that IFF_ALLMULTI is almost always set.

 OpenBSD's ac_multirangecnt is not NetBSD's ec_multicnt.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/if_age.c
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_ale.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/if_cas.c

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



CVS commit: src/sys/dev/pci

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 06:22:09 UTC 2019

Modified Files:
src/sys/dev/pci: if_age.c

Log Message:
 Fix multicast handling. All Atheros controllers use big-endian form
when computing multicast hash. Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 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.62 src/sys/dev/pci/if_age.c:1.63
--- src/sys/dev/pci/if_age.c:1.62	Wed Oct 30 07:26:28 2019
+++ src/sys/dev/pci/if_age.c	Thu Nov 21 06:22:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.62 2019/10/30 07:26:28 msaitoh Exp $ */
+/*	$NetBSD: if_age.c,v 1.63 2019/11/21 06:22:09 msaitoh 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 
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.62 2019/10/30 07:26:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.63 2019/11/21 06:22:09 msaitoh Exp $");
 
 #include "vlan.h"
 
@@ -2289,7 +2289,7 @@ age_rxfilter(struct age_softc *sc)
 		ETHER_LOCK(ec);
 		ETHER_FIRST_MULTI(step, ec, enm);
 		while (enm != NULL) {
-			crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN);
+			crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
 			mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
 			ETHER_NEXT_MULTI(step, enm);
 		}



CVS commit: src/sys/dev/pci

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 06:22:09 UTC 2019

Modified Files:
src/sys/dev/pci: if_age.c

Log Message:
 Fix multicast handling. All Atheros controllers use big-endian form
when computing multicast hash. Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 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.



CVS commit: src/sys/dev/mii

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 03:04:22 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c ipgphyreg.h

Log Message:
 Add missing NetBSD RCS Id. Reported by Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/ipgphy.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/ipgphyreg.h

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



CVS commit: src/sys/dev/mii

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 03:04:22 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c ipgphyreg.h

Log Message:
 Add missing NetBSD RCS Id. Reported by Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/ipgphy.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/ipgphyreg.h

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

Modified files:

Index: src/sys/dev/mii/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.4 src/sys/dev/mii/ipgphy.c:1.5
--- src/sys/dev/mii/ipgphy.c:1.4	Thu Nov 14 09:06:21 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 21 03:04:21 2019
@@ -1,3 +1,4 @@
+/*	$NetBSD: ipgphy.c,v 1.5 2019/11/21 03:04:21 msaitoh Exp $ */
 /*	$OpenBSD: ipgphy.c,v 1.19 2015/07/19 06:28:12 yuo Exp $	*/
 
 /*-
@@ -32,7 +33,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.4 2019/11/14 09:06:21 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.5 2019/11/21 03:04:21 msaitoh Exp $");
 
 #include 
 #include 

Index: src/sys/dev/mii/ipgphyreg.h
diff -u src/sys/dev/mii/ipgphyreg.h:1.2 src/sys/dev/mii/ipgphyreg.h:1.3
--- src/sys/dev/mii/ipgphyreg.h:1.2	Tue Nov 12 14:07:09 2019
+++ src/sys/dev/mii/ipgphyreg.h	Thu Nov 21 03:04:21 2019
@@ -1,3 +1,4 @@
+/*	$NetBSD: ipgphyreg.h,v 1.3 2019/11/21 03:04:21 msaitoh Exp $ */
 /*	$OpenBSD: ipgphyreg.h,v 1.3 2015/07/19 06:28:12 yuo Exp $	*/
 
 /*-



CVS commit: src/sys/dev/pci

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 02:59:44 UTC 2019

Modified Files:
src/sys/dev/pci: if_vge.c

Log Message:
- Set duplex correctly when user setting is not IFM_AUTO.
- When the link is up, set VGE_DIAGCTL not from user media setting but from
  the current active link status.


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

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



CVS commit: src/sys/dev/pci

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 02:59:44 UTC 2019

Modified Files:
src/sys/dev/pci: if_vge.c

Log Message:
- Set duplex correctly when user setting is not IFM_AUTO.
- When the link is up, set VGE_DIAGCTL not from user media setting but from
  the current active link status.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pci/if_vge.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_vge.c
diff -u src/sys/dev/pci/if_vge.c:1.76 src/sys/dev/pci/if_vge.c:1.77
--- src/sys/dev/pci/if_vge.c:1.76	Tue Nov 19 09:54:07 2019
+++ src/sys/dev/pci/if_vge.c	Thu Nov 21 02:59:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vge.c,v 1.76 2019/11/19 09:54:07 msaitoh Exp $ */
+/* $NetBSD: if_vge.c,v 1.77 2019/11/21 02:59:43 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.76 2019/11/19 09:54:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.77 2019/11/21 02:59:43 msaitoh Exp $");
 
 /*
  * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
@@ -1928,33 +1928,34 @@ vge_miibus_statchg(struct ifnet *ifp)
 	 * always implied, so we turn on the forced mode bit but leave
 	 * the FDX bit cleared.
 	 */
-
 	dctl = CSR_READ_1(sc, VGE_DIAGCTL);
 
-	switch (IFM_SUBTYPE(ife->ifm_media)) {
-	case IFM_AUTO:
+	if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) {
 		dctl &= ~VGE_DIAGCTL_MACFORCE;
 		dctl &= ~VGE_DIAGCTL_FDXFORCE;
-		break;
-	case IFM_1000_T:
-		dctl |= VGE_DIAGCTL_MACFORCE;
-		dctl &= ~VGE_DIAGCTL_FDXFORCE;
-		dctl |= VGE_DIAGCTL_GMII;
-		break;
-	case IFM_100_TX:
-	case IFM_10_T:
+	} else {
+		u_int ifmword;
+
+		/* If the link is up, use the current active media. */
+		if ((mii->mii_media_status & IFM_ACTIVE) != 0)
+			ifmword = mii->mii_media_active;
+		else
+			ifmword = ife->ifm_media;
+
 		dctl |= VGE_DIAGCTL_MACFORCE;
-		dctl &= ~VGE_DIAGCTL_GMII;
-		if ((ife->ifm_media & IFM_FDX) != 0)
+		if ((ifmword & IFM_FDX) != 0)
 			dctl |= VGE_DIAGCTL_FDXFORCE;
 		else
 			dctl &= ~VGE_DIAGCTL_FDXFORCE;
-		break;
-	default:
-		printf("%s: unknown media type: %x\n",
-		device_xname(sc->sc_dev),
-		IFM_SUBTYPE(ife->ifm_media));
-		break;
+
+		if (IFM_SUBTYPE(ifmword) == IFM_1000_T) {
+			/*
+			 * It means the user setting is not auto but it's
+			 * 1000baseT-FDX or 1000baseT.
+			 */
+			dctl |= VGE_DIAGCTL_GMII;
+		} else
+			dctl &= ~VGE_DIAGCTL_GMII;
 	}
 
 	CSR_WRITE_1(sc, VGE_DIAGCTL, dctl);



CVS commit: src/sys/dev/mii

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 20 08:51:00 UTC 2019

Modified Files:
src/sys/dev/mii: atphy.c mii_physubr.c miivar.h

Log Message:
 Fix a bug that atphy(4) can't negotiate correctly when the media setting is
neither auto nor 1000baseT. Use correct index for mii_media_table[].

 History: mii_anar() is first added in OpenBSD and ported to NetBSD. On NetBSD,
only atphy(4) use this function. mii_physubr.c rev. 1.75 changed mii_anar()
for simplify. It changed the argument from the ifmedia word to ifm_data used
in our MII API, but the caller have not been changed. And then, PR kern/50206
was reported and the caller was modified by me to prevent panic but it was not
correct fix.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/mii/miivar.h

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

Modified files:

Index: src/sys/dev/mii/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.24 src/sys/dev/mii/atphy.c:1.25
--- src/sys/dev/mii/atphy.c:1.24	Fri Oct 18 12:53:08 2019
+++ src/sys/dev/mii/atphy.c	Wed Nov 20 08:50:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.24 2019/10/18 12:53:08 hkenken Exp $ */
+/*	$NetBSD: atphy.c,v 1.25 2019/11/20 08:50:59 msaitoh Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.24 2019/10/18 12:53:08 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.25 2019/11/20 08:50:59 msaitoh Exp $");
 
 #include 
 #include 
@@ -273,7 +273,7 @@ atphy_service(struct mii_softc *sc, stru
 			return EINVAL;
 		}
 
-		anar = mii_anar(IFM_SUBTYPE(ife->ifm_media));
+		anar = mii_anar(ife);
 		if ((ife->ifm_media & IFM_FDX) != 0) {
 			bmcr |= BMCR_FDX;
 			/* Enable pause. */

Index: src/sys/dev/mii/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.87 src/sys/dev/mii/mii_physubr.c:1.88
--- src/sys/dev/mii/mii_physubr.c:1.87	Tue Apr  9 11:28:45 2019
+++ src/sys/dev/mii/mii_physubr.c	Wed Nov 20 08:50:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii_physubr.c,v 1.87 2019/04/09 11:28:45 msaitoh Exp $	*/
+/*	$NetBSD: mii_physubr.c,v 1.88 2019/11/20 08:50:59 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.87 2019/04/09 11:28:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.88 2019/11/20 08:50:59 msaitoh Exp $");
 
 #include 
 #include 
@@ -697,19 +697,16 @@ mii_phy_resume(device_t dv, const pmf_qu
 
 
 /*
- * Given an ifmedia word, return the corresponding ANAR value.
+ * Given an ifmedia_entry, return the corresponding ANAR value.
  */
 uint16_t
-mii_anar(int media)
+mii_anar(struct ifmedia_entry *ife)
 {
-	int rv;
 
 #ifdef DIAGNOSTIC
-	if (/* media < 0 || */ media >= MII_NMEDIA)
+	if (ife->ifm_data >= MII_NMEDIA)
 		panic("mii_anar");
 #endif
 
-	rv = mii_media_table[media].mm_anar;
-
-	return rv;
+	return mii_media_table[ife->ifm_data].mm_anar;
 }

Index: src/sys/dev/mii/miivar.h
diff -u src/sys/dev/mii/miivar.h:1.68 src/sys/dev/mii/miivar.h:1.69
--- src/sys/dev/mii/miivar.h:1.68	Thu Apr 11 09:14:07 2019
+++ src/sys/dev/mii/miivar.h	Wed Nov 20 08:50:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miivar.h,v 1.68 2019/04/11 09:14:07 msaitoh Exp $	*/
+/*	$NetBSD: miivar.h,v 1.69 2019/11/20 08:50:59 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -287,7 +287,7 @@ int	mii_mediachg(struct mii_data *);
 void	mii_tick(struct mii_data *);
 void	mii_pollstat(struct mii_data *);
 void	mii_down(struct mii_data *);
-uint16_t mii_anar(int);
+uint16_t mii_anar(struct ifmedia_entry *);
 
 int	mii_ifmedia_change(struct mii_data *);
 



CVS commit: src/sys/dev/mii

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 20 08:51:00 UTC 2019

Modified Files:
src/sys/dev/mii: atphy.c mii_physubr.c miivar.h

Log Message:
 Fix a bug that atphy(4) can't negotiate correctly when the media setting is
neither auto nor 1000baseT. Use correct index for mii_media_table[].

 History: mii_anar() is first added in OpenBSD and ported to NetBSD. On NetBSD,
only atphy(4) use this function. mii_physubr.c rev. 1.75 changed mii_anar()
for simplify. It changed the argument from the ifmedia word to ifm_data used
in our MII API, but the caller have not been changed. And then, PR kern/50206
was reported and the caller was modified by me to prevent panic but it was not
correct fix.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/mii/miivar.h

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



CVS commit: src/sys/dev/pci

2019-11-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 19 09:54:07 UTC 2019

Modified Files:
src/sys/dev/pci: if_vge.c

Log Message:
 Fixes a bug that "ifmedia vge0 media 1000baseT-FDX" causes device timeout.

If the interface's media is NOT in the "best" mode (i.e. other than IFM_AUTO),
control VGE_DIAGCTL_GMII bit.


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

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



CVS commit: src/sys/dev/pci

2019-11-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 19 09:54:07 UTC 2019

Modified Files:
src/sys/dev/pci: if_vge.c

Log Message:
 Fixes a bug that "ifmedia vge0 media 1000baseT-FDX" causes device timeout.

If the interface's media is NOT in the "best" mode (i.e. other than IFM_AUTO),
control VGE_DIAGCTL_GMII bit.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/if_vge.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_vge.c
diff -u src/sys/dev/pci/if_vge.c:1.75 src/sys/dev/pci/if_vge.c:1.76
--- src/sys/dev/pci/if_vge.c:1.75	Tue Oct  8 14:26:27 2019
+++ src/sys/dev/pci/if_vge.c	Tue Nov 19 09:54:07 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vge.c,v 1.75 2019/10/08 14:26:27 msaitoh Exp $ */
+/* $NetBSD: if_vge.c,v 1.76 2019/11/19 09:54:07 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.75 2019/10/08 14:26:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.76 2019/11/19 09:54:07 msaitoh Exp $");
 
 /*
  * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
@@ -1916,6 +1916,7 @@ vge_miibus_statchg(struct ifnet *ifp)
 	struct vge_softc *sc = ifp->if_softc;
 	struct mii_data *mii = >sc_mii;
 	struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
+	uint8_t dctl;
 
 	/*
 	 * If the user manually selects a media mode, we need to turn
@@ -1928,23 +1929,26 @@ vge_miibus_statchg(struct ifnet *ifp)
 	 * the FDX bit cleared.
 	 */
 
+	dctl = CSR_READ_1(sc, VGE_DIAGCTL);
+
 	switch (IFM_SUBTYPE(ife->ifm_media)) {
 	case IFM_AUTO:
-		CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE);
-		CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_FDXFORCE);
+		dctl &= ~VGE_DIAGCTL_MACFORCE;
+		dctl &= ~VGE_DIAGCTL_FDXFORCE;
 		break;
 	case IFM_1000_T:
-		CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE);
-		CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_FDXFORCE);
+		dctl |= VGE_DIAGCTL_MACFORCE;
+		dctl &= ~VGE_DIAGCTL_FDXFORCE;
+		dctl |= VGE_DIAGCTL_GMII;
 		break;
 	case IFM_100_TX:
 	case IFM_10_T:
-		CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE);
-		if ((ife->ifm_media & IFM_FDX) != 0) {
-			CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_FDXFORCE);
-		} else {
-			CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_FDXFORCE);
-		}
+		dctl |= VGE_DIAGCTL_MACFORCE;
+		dctl &= ~VGE_DIAGCTL_GMII;
+		if ((ife->ifm_media & IFM_FDX) != 0)
+			dctl |= VGE_DIAGCTL_FDXFORCE;
+		else
+			dctl &= ~VGE_DIAGCTL_FDXFORCE;
 		break;
 	default:
 		printf("%s: unknown media type: %x\n",
@@ -1952,6 +1956,8 @@ vge_miibus_statchg(struct ifnet *ifp)
 		IFM_SUBTYPE(ife->ifm_media));
 		break;
 	}
+
+	CSR_WRITE_1(sc, VGE_DIAGCTL, dctl);
 }
 
 static int



CVS commit: [netbsd-9] src/doc

2019-11-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 19 06:21:24 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
 Ticket #443.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.107 -r1.1.2.108 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-11-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 19 06:21:24 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
 Ticket #443.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.107 -r1.1.2.108 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.107 src/doc/CHANGES-9.0:1.1.2.108
--- src/doc/CHANGES-9.0:1.1.2.107	Mon Nov 18 19:48:41 2019
+++ src/doc/CHANGES-9.0	Tue Nov 19 06:21:24 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.107 2019/11/18 19:48:41 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.108 2019/11/19 06:21:24 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -5924,3 +5924,7 @@ sys/dev/pci/if_mcx.c1.6
 	Fixed incorrect m_defrag return value check.
 	[nonaka, ticket #441]
 
+usr.sbin/sysinst/arch/i386/md.c			1.25-1.26
+
+	Fix KASLR support for amd64.
+	[martin, ticket #443]



CVS commit: [netbsd-9] src/usr.sbin/sysinst/arch/i386

2019-11-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 19 06:19:04 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #443):
usr.sbin/sysinst/arch/i386/md.c: revision 1.25
usr.sbin/sysinst/arch/i386/md.c: revision 1.26
Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.
Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


To generate a diff of this commit:
cvs rdiff -u -r1.20.2.2 -r1.20.2.3 src/usr.sbin/sysinst/arch/i386/md.c

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

Modified files:

Index: src/usr.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.2 src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.3
--- src/usr.sbin/sysinst/arch/i386/md.c:1.20.2.2	Sun Nov 17 13:45:26 2019
+++ src/usr.sbin/sysinst/arch/i386/md.c	Tue Nov 19 06:19:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.20.2.2 2019/11/17 13:45:26 msaitoh Exp $ */
+/*	$NetBSD: md.c,v 1.20.2.3 2019/11/19 06:19:04 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -376,13 +376,6 @@ md_post_newfs_uefi(struct install_partit
 int
 md_post_newfs(struct install_partition_desc *install)
 {
-#if defined(__amd64__)
-	int ret;
-
-	ret = cp_to_target("/usr/mdec/prekern", "/prekern");
-	if (ret)
-		return ret;
-#endif
 
 	return uefi_boot ? md_post_newfs_uefi(install)
 	: md_post_newfs_bios(install);
@@ -391,6 +384,15 @@ md_post_newfs(struct install_partition_d
 int
 md_post_extract(struct install_partition_desc *install)
 {
+#if defined(__amd64__)
+	if (get_kernel_set() == SET_KERNEL_2) {
+		int ret;
+
+		ret = cp_within_target("/usr/mdec/prekern", "/prekern", 0);
+		if (ret)
+			return ret;
+	}
+#endif
 	return 0;
 }
 



CVS commit: [netbsd-9] src/usr.sbin/sysinst/arch/i386

2019-11-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 19 06:19:04 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #443):
usr.sbin/sysinst/arch/i386/md.c: revision 1.25
usr.sbin/sysinst/arch/i386/md.c: revision 1.26
Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.
Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


To generate a diff of this commit:
cvs rdiff -u -r1.20.2.2 -r1.20.2.3 src/usr.sbin/sysinst/arch/i386/md.c

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



CVS commit: src/sys/dev/mii

2019-11-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 18 15:09:59 UTC 2019

Modified Files:
src/sys/dev/mii: ihphy.c

Log Message:
 Remove extra 10ms delay in ihphy_reset(). The delay are in if_wm.c side.
It's required for hardware full reset and it't not requred on soft reset.
 When ihphy.c was added in 9 years ago, some workaround code were not in
if_wm.c yet and the initialization code was not good.


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

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



CVS commit: src/sys/dev/pci/ixgbe

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 18 03:17:51 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
 Print MAC address.

 XXX Should we move such type of printf() to ether_ifattach?


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.140 -r1.141 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.215 src/sys/dev/pci/ixgbe/ixgbe.c:1.216
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.215	Sun Nov 10 21:16:36 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Nov 18 03:17:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.215 2019/11/10 21:16:36 chs Exp $ */
+/* $NetBSD: ixgbe.c,v 1.216 2019/11/18 03:17:51 msaitoh Exp $ */
 
 /**
 
@@ -1333,6 +1333,8 @@ ixgbe_setup_interface(device_t dev, stru
 	}
 	adapter->ipq = if_percpuq_create(>osdep.ec.ec_if);
 	ether_ifattach(ifp, adapter->hw.mac.addr);
+	aprint_normal_dev(dev, "Ethernet address %s\n",
+	ether_sprintf(adapter->hw.mac.addr));
 	/*
 	 * We use per TX queue softint, so if_deferred_start_init() isn't
 	 * used.

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.140 src/sys/dev/pci/ixgbe/ixv.c:1.141
--- src/sys/dev/pci/ixgbe/ixv.c:1.140	Wed Nov  6 04:17:16 2019
+++ src/sys/dev/pci/ixgbe/ixv.c	Mon Nov 18 03:17:51 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.140 2019/11/06 04:17:16 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.141 2019/11/18 03:17:51 msaitoh Exp $*/
 
 /**
 
@@ -1610,6 +1610,8 @@ ixv_setup_interface(device_t dev, struct
 	}
 	adapter->ipq = if_percpuq_create(>osdep.ec.ec_if);
 	ether_ifattach(ifp, adapter->hw.mac.addr);
+	aprint_normal_dev(dev, "Ethernet address %s\n",
+	ether_sprintf(adapter->hw.mac.addr));
 	/*
 	 * We use per TX queue softint, so if_deferred_start_init() isn't
 	 * used.



CVS commit: src/sys/dev/pci/ixgbe

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 18 03:17:51 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
 Print MAC address.

 XXX Should we move such type of printf() to ether_ifattach?


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.140 -r1.141 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/usr.sbin/cpuctl/arch

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 15:32:00 UTC 2019

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
0x7d and 0x7e are for 10th generation Core (Ice Lake).


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.107 src/usr.sbin/cpuctl/arch/i386.c:1.108
--- src/usr.sbin/cpuctl/arch/i386.c:1.107	Thu Oct  3 15:21:44 2019
+++ src/usr.sbin/cpuctl/arch/i386.c	Sun Nov 17 15:32:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.107 2019/10/03 15:21:44 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.108 2019/11/17 15:32:00 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.107 2019/10/03 15:21:44 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.108 2019/11/17 15:32:00 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -386,8 +386,8 @@ const struct cpu_cpuid_nameclass i386_cp
 [0x6a] = "Future Xeon (Ice Lake)",
 [0x6c] = "Future Xeon (Ice Lake)",
 [0x7a] = "Atom (Goldmont Plus)",
-[0x7d] = "Future Core (Ice Lake)",
-[0x7e] = "Future Core (Ice Lake)",
+[0x7d] = "10th gen Core (Ice Lake)",
+[0x7e] = "10th gen Core (Ice Lake)",
 [0x85] = "Xeon Phi 7215, 7285, 7295 (Knights Mill)",
 [0x86] = "Atom (Tremont)",
 [0x8e] = "7th or 8th gen Core (Kaby Lake, Coffee Lake) or Xeon E (Coffee Lake)",



CVS commit: src/usr.sbin/cpuctl/arch

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 15:32:00 UTC 2019

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
0x7d and 0x7e are for 10th generation Core (Ice Lake).


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.sbin/cpuctl/arch/i386.c

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



CVS commit: src/sys/arch/x86/include

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 15:31:05 UTC 2019

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Add the following bit definitions from the latest Intel SDM:
 - CET shadow stack
 - Fast Short REP MOV
 - Hybrid part
 - CET Indirect Branch Tracking


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/arch/x86/include/specialreg.h

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



CVS commit: src/sys/arch/x86/include

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 15:31:05 UTC 2019

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Add the following bit definitions from the latest Intel SDM:
 - CET shadow stack
 - Fast Short REP MOV
 - Hybrid part
 - CET Indirect Branch Tracking


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/arch/x86/include/specialreg.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/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.157 src/sys/arch/x86/include/specialreg.h:1.158
--- src/sys/arch/x86/include/specialreg.h:1.157	Tue Nov 12 18:00:13 2019
+++ src/sys/arch/x86/include/specialreg.h	Sun Nov 17 15:31:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.157 2019/11/12 18:00:13 maxv Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.158 2019/11/17 15:31:05 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2019 The NetBSD Foundation, Inc.
@@ -447,6 +447,7 @@
 #define CPUID_SEF_OSPKE		__BIT(4)  /* OS has set CR4.PKE to ena. protec. keys */
 #define CPUID_SEF_WAITPKG	__BIT(5)  /* TPAUSE,UMONITOR,UMWAIT */
 #define CPUID_SEF_AVX512_VBMI2	__BIT(6)  /* AVX-512 Vector Byte Manipulation 2 */
+#define CPUID_SEF_CET_SS	__BIT(7)  /* CET shadow stack */
 #define CPUID_SEF_GFNI		__BIT(8)
 #define CPUID_SEF_VAES		__BIT(9)
 #define CPUID_SEF_VPCLMULQDQ	__BIT(10)
@@ -462,7 +463,7 @@
 
 #define CPUID_SEF_FLAGS1	"\177\20" \
 	"b\0PREFETCHWT1\0" "b\1AVX512_VBMI\0" "b\2UMIP\0" "b\3PKU\0"	\
-	"b\4OSPKE\0"	"b\5WAITPKG\0"	"b\6AVX512_VBMI2\0"		  \
+	"b\4OSPKE\0"	"b\5WAITPKG\0"	"b\6AVX512_VBMI2\0" "b\7CET_SS\0" \
 	"b\10GFNI\0"	"b\11VAES\0"	"b\12VPCLMULQDQ\0" "b\13AVX512_VNNI\0"\
 	"b\14AVX512_BITALG\0"		"b\16AVX512_VPOPCNTDQ\0"	\
 	"f\21\5MAWAU\0"			\
@@ -473,8 +474,11 @@
 /* %edx */
 #define CPUID_SEF_AVX512_4VNNIW	__BIT(2)
 #define CPUID_SEF_AVX512_4FMAPS	__BIT(3)
+#define CPUID_SEF_FSREP_MOV	__BIT(4)  /* Fast Short REP MOV */
 #define CPUID_SEF_MD_CLEAR	__BIT(10)
 #define CPUID_SEF_TSX_FORCE_ABORT __BIT(13) /* MSR_TSX_FORCE_ABORT bit 0 */
+#define CPUID_SEF_HYBRID	__BIT(15) /* Hybrid part */
+#define CPUID_SEF_CET_IBT	__BIT(20) /* CET Indirect Branch Tracking */
 #define CPUID_SEF_IBRS		__BIT(26) /* IBRS / IBPB Speculation Control */
 #define CPUID_SEF_STIBP		__BIT(27) /* STIBP Speculation Control */
 #define CPUID_SEF_L1D_FLUSH	__BIT(28) /* IA32_FLUSH_CMD MSR */
@@ -484,8 +488,10 @@
 
 #define CPUID_SEF_FLAGS2	"\20" \
 "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \
+	"\5" "FSREP_MOV"		\
 "\13" "MD_CLEAR"			\
-			"\16" "TSX_FORCE_ABORT"\
+			"\16" "TSX_FORCE_ABORT"		"\20" "HYBRID"	\
+	"\25" "CET_IBT"			\
 	"\33" "IBRS"	"\34" "STIBP"	\
 	"\35" "L1D_FLUSH" "\36" "ARCH_CAP" "\37CORE_CAP"	"\40" "SSBD"
 



CVS commit: [netbsd-9] src/doc

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 13:50:13 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #433 and #436.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.105 -r1.1.2.106 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 13:50:13 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #433 and #436.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.105 -r1.1.2.106 src/doc/CHANGES-9.0

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.105 src/doc/CHANGES-9.0:1.1.2.106
--- src/doc/CHANGES-9.0:1.1.2.105	Sun Nov 17 07:13:09 2019
+++ src/doc/CHANGES-9.0	Sun Nov 17 13:50:13 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.105 2019/11/17 07:13:09 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.106 2019/11/17 13:50:13 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -5832,3 +5832,55 @@ usr.sbin/sysinst/util.c1.33
 	Make /rescue into a separate set and minor cleanup of /rescue.
 	[maya, ticket #435]
 
+usr.bin/msgc/msg_sys.def			1.48
+
+	msg_table_add(): Fix mishap in the format safety changes in r1.45.
+	[martin, ticket #433]
+
+usr.sbin/sysinst/Makefile.inc			1.29-1.30
+usr.sbin/sysinst/arch/amd64/md.c		1.2
+usr.sbin/sysinst/arch/amd64/md.h		1.8
+usr.sbin/sysinst/arch/ews4800mips/Makefile	1.3
+usr.sbin/sysinst/arch/i386/md.c			1.22-1.24
+usr.sbin/sysinst/arch/i386/menus.md		1.3
+usr.sbin/sysinst/arch/i386/msg.md.de		1.2-.1.4
+usr.sbin/sysinst/arch/i386/msg.md.en		1.2-1.4
+usr.sbin/sysinst/arch/i386/msg.md.es		1.2-1.4
+usr.sbin/sysinst/arch/i386/msg.md.fr		1.2-1.4
+usr.sbin/sysinst/arch/i386/msg.md.pl		1.2-1.4
+usr.sbin/sysinst/arch/playstation2/msg.md.de	1.3
+usr.sbin/sysinst/arch/playstation2/msg.md.en	1.3
+usr.sbin/sysinst/arch/playstation2/msg.md.es	1.3
+usr.sbin/sysinst/arch/playstation2/msg.md.fr	1.3
+usr.sbin/sysinst/arch/playstation2/msg.md.pl	1.3
+usr.sbin/sysinst/bsddisklabel.c			1.30-1.31
+usr.sbin/sysinst/configmenu.c			1.11
+usr.sbin/sysinst/defs.h1.46-1.48
+usr.sbin/sysinst/disklabel.c			1.15
+usr.sbin/sysinst/disks.c			1.55-1.57
+usr.sbin/sysinst/gpt.c1.12
+usr.sbin/sysinst/install.c			1.12-1.13
+usr.sbin/sysinst/label.c			1.13-1.14
+usr.sbin/sysinst/main.c1.18
+usr.sbin/sysinst/mbr.c1.22
+usr.sbin/sysinst/mbr.h1.4
+usr.sbin/sysinst/msg.mi.de			1.17-1.18
+usr.sbin/sysinst/msg.mi.en			1.24-1.25
+usr.sbin/sysinst/msg.mi.es			1.18-1.19
+usr.sbin/sysinst/msg.mi.fr			1.22-1.23
+usr.sbin/sysinst/msg.mi.pl			1.25-1.26
+usr.sbin/sysinst/net.c1.34
+usr.sbin/sysinst/part_edit.c			1.11-1.13
+usr.sbin/sysinst/partitions.c			1.5
+usr.sbin/sysinst/partitions.h			1.8
+usr.sbin/sysinst/partman.c			1.44
+usr.sbin/sysinst/run.c1.13
+usr.sbin/sysinst/util.c1.35-1.40
+
+	Various sysinst changes:
+	 - allow cloning of alien partitions
+	 - adjust tar extraction flags depending on the tar variant in use
+	 - fix a few missing translations (always using "x: Exit" in menus)
+	 - x86: improve boot block selection menu
+	 - amd64: allow installation of KASLR kernel via "Custom Install"
+	[martin, ticket #436]



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 13:45:26 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: Makefile.inc bsddisklabel.c
configmenu.c defs.h disklabel.c disks.c gpt.c install.c label.c
main.c mbr.c mbr.h msg.mi.de msg.mi.en msg.mi.es msg.mi.fr
msg.mi.pl net.c part_edit.c partitions.c partitions.h partman.c
run.c util.c
src/usr.sbin/sysinst/arch/amd64 [netbsd-9]: md.c md.h
src/usr.sbin/sysinst/arch/ews4800mips [netbsd-9]: Makefile
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c menus.md msg.md.de
msg.md.en msg.md.es msg.md.fr msg.md.pl
src/usr.sbin/sysinst/arch/playstation2 [netbsd-9]: msg.md.de msg.md.en
msg.md.es msg.md.fr msg.md.pl

Log Message:
Pull up following revision(s) (requested by martin in ticket #436):
usr.sbin/sysinst/disks.c: revision 1.55
usr.sbin/sysinst/msg.mi.en: revision 1.24
usr.sbin/sysinst/mbr.c: revision 1.22
usr.sbin/sysinst/disks.c: revision 1.56
usr.sbin/sysinst/msg.mi.en: revision 1.25
usr.sbin/sysinst/disks.c: revision 1.57
usr.sbin/sysinst/arch/playstation2/msg.md.pl: revision 1.3
usr.sbin/sysinst/Makefile.inc: revision 1.30
usr.sbin/sysinst/configmenu.c: revision 1.11
usr.sbin/sysinst/util.c: revision 1.35
usr.sbin/sysinst/gpt.c: revision 1.12
usr.sbin/sysinst/util.c: revision 1.36
usr.sbin/sysinst/arch/playstation2/msg.md.de: revision 1.3
usr.sbin/sysinst/arch/i386/menus.md: revision 1.3
usr.sbin/sysinst/util.c: revision 1.37
usr.sbin/sysinst/part_edit.c: revision 1.11
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.2
usr.sbin/sysinst/util.c: revision 1.38
usr.sbin/sysinst/part_edit.c: revision 1.12
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.3
usr.sbin/sysinst/util.c: revision 1.39
usr.sbin/sysinst/part_edit.c: revision 1.13
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.4
usr.sbin/sysinst/disklabel.c: revision 1.15
usr.sbin/sysinst/bsddisklabel.c: revision 1.30
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.2
usr.sbin/sysinst/bsddisklabel.c: revision 1.31
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.4
usr.sbin/sysinst/mbr.h: revision 1.4
usr.sbin/sysinst/main.c: revision 1.18
usr.sbin/sysinst/partman.c: revision 1.44
usr.sbin/sysinst/msg.mi.de: revision 1.17
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.2
usr.sbin/sysinst/msg.mi.de: revision 1.18
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.3
usr.sbin/sysinst/arch/playstation2/msg.md.en: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.4
usr.sbin/sysinst/arch/amd64/md.c: revision 1.2
usr.sbin/sysinst/arch/ews4800mips/Makefile: revision 1.3
usr.sbin/sysinst/arch/playstation2/msg.md.es: revision 1.3
usr.sbin/sysinst/label.c: revision 1.13
usr.sbin/sysinst/Makefile.inc: revision 1.29
usr.sbin/sysinst/label.c: revision 1.14
usr.sbin/sysinst/util.c: revision 1.40
usr.sbin/sysinst/partitions.c: revision 1.5
usr.sbin/sysinst/arch/amd64/md.h: revision 1.8
usr.sbin/sysinst/msg.mi.es: revision 1.18
usr.sbin/sysinst/net.c: revision 1.34
usr.sbin/sysinst/msg.mi.es: revision 1.19
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.2
usr.sbin/sysinst/arch/i386/md.c: revision 1.22
usr.sbin/sysinst/msg.mi.fr: revision 1.22
usr.sbin/sysinst/arch/playstation2/msg.md.fr: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.3
usr.sbin/sysinst/arch/i386/md.c: revision 1.23
usr.sbin/sysinst/msg.mi.pl: revision 1.25
usr.sbin/sysinst/msg.mi.fr: revision 1.23
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.4
usr.sbin/sysinst/arch/i386/md.c: revision 1.24
usr.sbin/sysinst/partitions.h: revision 1.8
usr.sbin/sysinst/msg.mi.pl: revision 1.26
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.2
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.4
usr.sbin/sysinst/run.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.46
usr.sbin/sysinst/install.c: revision 1.12
usr.sbin/sysinst/defs.h: revision 1.47
usr.sbin/sysinst/install.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.48
Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).
PR 54467: we trust our own sets, extract them with -P to allow symlink
redirection (especially for updates and chroot services - back out
once a better solution for those is implemented)
Make cloning support 

CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 13:45:26 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: Makefile.inc bsddisklabel.c
configmenu.c defs.h disklabel.c disks.c gpt.c install.c label.c
main.c mbr.c mbr.h msg.mi.de msg.mi.en msg.mi.es msg.mi.fr
msg.mi.pl net.c part_edit.c partitions.c partitions.h partman.c
run.c util.c
src/usr.sbin/sysinst/arch/amd64 [netbsd-9]: md.c md.h
src/usr.sbin/sysinst/arch/ews4800mips [netbsd-9]: Makefile
src/usr.sbin/sysinst/arch/i386 [netbsd-9]: md.c menus.md msg.md.de
msg.md.en msg.md.es msg.md.fr msg.md.pl
src/usr.sbin/sysinst/arch/playstation2 [netbsd-9]: msg.md.de msg.md.en
msg.md.es msg.md.fr msg.md.pl

Log Message:
Pull up following revision(s) (requested by martin in ticket #436):
usr.sbin/sysinst/disks.c: revision 1.55
usr.sbin/sysinst/msg.mi.en: revision 1.24
usr.sbin/sysinst/mbr.c: revision 1.22
usr.sbin/sysinst/disks.c: revision 1.56
usr.sbin/sysinst/msg.mi.en: revision 1.25
usr.sbin/sysinst/disks.c: revision 1.57
usr.sbin/sysinst/arch/playstation2/msg.md.pl: revision 1.3
usr.sbin/sysinst/Makefile.inc: revision 1.30
usr.sbin/sysinst/configmenu.c: revision 1.11
usr.sbin/sysinst/util.c: revision 1.35
usr.sbin/sysinst/gpt.c: revision 1.12
usr.sbin/sysinst/util.c: revision 1.36
usr.sbin/sysinst/arch/playstation2/msg.md.de: revision 1.3
usr.sbin/sysinst/arch/i386/menus.md: revision 1.3
usr.sbin/sysinst/util.c: revision 1.37
usr.sbin/sysinst/part_edit.c: revision 1.11
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.2
usr.sbin/sysinst/util.c: revision 1.38
usr.sbin/sysinst/part_edit.c: revision 1.12
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.3
usr.sbin/sysinst/util.c: revision 1.39
usr.sbin/sysinst/part_edit.c: revision 1.13
usr.sbin/sysinst/arch/i386/msg.md.en: revision 1.4
usr.sbin/sysinst/disklabel.c: revision 1.15
usr.sbin/sysinst/bsddisklabel.c: revision 1.30
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.2
usr.sbin/sysinst/bsddisklabel.c: revision 1.31
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.es: revision 1.4
usr.sbin/sysinst/mbr.h: revision 1.4
usr.sbin/sysinst/main.c: revision 1.18
usr.sbin/sysinst/partman.c: revision 1.44
usr.sbin/sysinst/msg.mi.de: revision 1.17
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.2
usr.sbin/sysinst/msg.mi.de: revision 1.18
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.3
usr.sbin/sysinst/arch/playstation2/msg.md.en: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.fr: revision 1.4
usr.sbin/sysinst/arch/amd64/md.c: revision 1.2
usr.sbin/sysinst/arch/ews4800mips/Makefile: revision 1.3
usr.sbin/sysinst/arch/playstation2/msg.md.es: revision 1.3
usr.sbin/sysinst/label.c: revision 1.13
usr.sbin/sysinst/Makefile.inc: revision 1.29
usr.sbin/sysinst/label.c: revision 1.14
usr.sbin/sysinst/util.c: revision 1.40
usr.sbin/sysinst/partitions.c: revision 1.5
usr.sbin/sysinst/arch/amd64/md.h: revision 1.8
usr.sbin/sysinst/msg.mi.es: revision 1.18
usr.sbin/sysinst/net.c: revision 1.34
usr.sbin/sysinst/msg.mi.es: revision 1.19
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.2
usr.sbin/sysinst/arch/i386/md.c: revision 1.22
usr.sbin/sysinst/msg.mi.fr: revision 1.22
usr.sbin/sysinst/arch/playstation2/msg.md.fr: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.3
usr.sbin/sysinst/arch/i386/md.c: revision 1.23
usr.sbin/sysinst/msg.mi.pl: revision 1.25
usr.sbin/sysinst/msg.mi.fr: revision 1.23
usr.sbin/sysinst/arch/i386/msg.md.pl: revision 1.4
usr.sbin/sysinst/arch/i386/md.c: revision 1.24
usr.sbin/sysinst/partitions.h: revision 1.8
usr.sbin/sysinst/msg.mi.pl: revision 1.26
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.2
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.3
usr.sbin/sysinst/arch/i386/msg.md.de: revision 1.4
usr.sbin/sysinst/run.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.46
usr.sbin/sysinst/install.c: revision 1.12
usr.sbin/sysinst/defs.h: revision 1.47
usr.sbin/sysinst/install.c: revision 1.13
usr.sbin/sysinst/defs.h: revision 1.48
Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).
PR 54467: we trust our own sets, extract them with -P to allow symlink
redirection (especially for updates and chroot services - back out
once a better solution for those is implemented)
Make cloning support 

CVS commit: [netbsd-9] src/usr.bin/msgc

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 13:36:18 UTC 2019

Modified Files:
src/usr.bin/msgc [netbsd-9]: msg_sys.def

Log Message:
Pull up following revision(s) (requested by martin in ticket #433):
usr.bin/msgc/msg_sys.def: revision 1.48
msg_table_add(): fix mishap in the format safety changes in r1.45


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.47.2.1 src/usr.bin/msgc/msg_sys.def

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

Modified files:

Index: src/usr.bin/msgc/msg_sys.def
diff -u src/usr.bin/msgc/msg_sys.def:1.47 src/usr.bin/msgc/msg_sys.def:1.47.2.1
--- src/usr.bin/msgc/msg_sys.def:1.47	Tue Jun 25 21:09:33 2019
+++ src/usr.bin/msgc/msg_sys.def	Sun Nov 17 13:36:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_sys.def,v 1.47 2019/06/25 21:09:33 joerg Exp $	*/
+/*	$NetBSD: msg_sys.def,v 1.47.2.1 2019/11/17 13:36:18 msaitoh Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -653,7 +653,7 @@ void
 msg_table_add(msg msg_no)
 {
 
-	msg_printf("%s", msg_string(msg_no));
+	msg_fmt_table_add(msg_no, "");
 }
 
 void __printflike(2, 3)



CVS commit: [netbsd-9] src/usr.bin/msgc

2019-11-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Nov 17 13:36:18 UTC 2019

Modified Files:
src/usr.bin/msgc [netbsd-9]: msg_sys.def

Log Message:
Pull up following revision(s) (requested by martin in ticket #433):
usr.bin/msgc/msg_sys.def: revision 1.48
msg_table_add(): fix mishap in the format safety changes in r1.45


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.47.2.1 src/usr.bin/msgc/msg_sys.def

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



CVS commit: src/sys/dev/ic

2019-11-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov 15 13:25:53 UTC 2019

Modified Files:
src/sys/dev/ic: rtl81x9reg.h

Log Message:
 Sort RTK_HWREV_* by value.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/ic/rtl81x9reg.h

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

Modified files:

Index: src/sys/dev/ic/rtl81x9reg.h
diff -u src/sys/dev/ic/rtl81x9reg.h:1.50 src/sys/dev/ic/rtl81x9reg.h:1.51
--- src/sys/dev/ic/rtl81x9reg.h:1.50	Fri Apr  5 23:46:04 2019
+++ src/sys/dev/ic/rtl81x9reg.h	Fri Nov 15 13:25:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtl81x9reg.h,v 1.50 2019/04/05 23:46:04 uwe Exp $	*/
+/*	$NetBSD: rtl81x9reg.h,v 1.51 2019/11/15 13:25:53 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998
@@ -149,7 +149,7 @@
 #define RTK_TXCFG_IFG		0x0300	/* interframe gap */
 #define RTK_TXCFG_HWREV		0x7CC0
 
-#define RTK_LOOPTEST_OFF		0x
+#define RTK_LOOPTEST_OFF	0x
 #define RTK_LOOPTEST_ON		0x0002
 #define RTK_LOOPTEST_ON_CPLUS	0x0006
 
@@ -166,11 +166,6 @@
 #define RTK_HWREV_8168E		0x2C00
 #define RTK_HWREV_8168E_VL	0x2C80
 #define RTK_HWREV_8168_SPIN1	0x3000
-#define RTK_HWREV_8168G		0x4c00
-#define RTK_HWREV_8168G_SPIN1	0x4c10
-#define RTK_HWREV_8168G_SPIN2	0x5090
-#define RTK_HWREV_8168G_SPIN4	0x5c80
-#define RTK_HWREV_8168GU	0x5080
 #define RTK_HWREV_8100E		0x3080
 #define RTK_HWREV_8101E		0x3400
 #define RTK_HWREV_8102E		0x3480
@@ -181,18 +176,23 @@
 #define RTK_HWREV_8168C_SPIN2	0x3C40
 #define RTK_HWREV_8168CP	0x3C80
 #define RTK_HWREV_8168F		0x4800
+#define RTK_HWREV_8168G		0x4c00
+#define RTK_HWREV_8168G_SPIN1	0x4c10
+#define RTK_HWREV_8168GU	0x5080
+#define RTK_HWREV_8168G_SPIN2	0x5090
 #define RTK_HWREV_8168H		0x5400
 #define RTK_HWREV_8168H_SPIN1	0x5410
+#define RTK_HWREV_8168G_SPIN4	0x5c80
 #define RTK_HWREV_8139		0x6000
 #define RTK_HWREV_8139A		0x7000
 #define RTK_HWREV_8139AG	0x7080
-#define RTK_HWREV_8139B		0x7800
-#define RTK_HWREV_8130		0x7C00
 #define RTK_HWREV_8139C		0x7400
 #define RTK_HWREV_8139D		0x7440
 #define RTK_HWREV_8139CPLUS	0x7480
 #define RTK_HWREV_8101		0x74c0
+#define RTK_HWREV_8139B		0x7800
 #define RTK_HWREV_8100		0x7880
+#define RTK_HWREV_8130		0x7C00
 #define RTK_HWREV_8169_8110SBL	0x7cc0
 
 #define RTK_TXDMA_16BYTES	0x



CVS commit: src/sys/dev/ic

2019-11-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov 15 13:25:53 UTC 2019

Modified Files:
src/sys/dev/ic: rtl81x9reg.h

Log Message:
 Sort RTK_HWREV_* by value.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/ic/rtl81x9reg.h

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



CVS commit: src/sys/dev/pci

2019-11-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov 15 12:38:09 UTC 2019

Modified Files:
src/sys/dev/pci: if_msk.c if_skreg.h

Log Message:
 Make Yukon EX, FE+, SUPR stable. The code is mainly taken from FreeBSD.

 At least, this change made my own Yukon EX machine (HP ProBook 4501s) much
stable than before.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/pci/if_msk.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/if_skreg.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_msk.c
diff -u src/sys/dev/pci/if_msk.c:1.93 src/sys/dev/pci/if_msk.c:1.94
--- src/sys/dev/pci/if_msk.c:1.93	Sun Nov 10 21:16:36 2019
+++ src/sys/dev/pci/if_msk.c	Fri Nov 15 12:38:09 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.93 2019/11/10 21:16:36 chs Exp $ */
+/* $NetBSD: if_msk.c,v 1.94 2019/11/15 12:38:09 msaitoh Exp $ */
 /*	$OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $	*/
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.93 2019/11/10 21:16:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.94 2019/11/15 12:38:09 msaitoh Exp $");
 
 #include 
 #include 
@@ -881,10 +881,27 @@ void
 mskc_reset(struct sk_softc *sc)
 {
 	uint32_t imtimer_ticks, reg1;
+	uint16_t status;
 	int reg;
 
 	DPRINTFN(2, ("mskc_reset\n"));
 
+	/* Disable ASF */
+	if ((sc->sk_type == SK_YUKON_EX) || (sc->sk_type == SK_YUKON_SUPR)) {
+		CSR_WRITE_4(sc, SK_Y2_CPU_WDOG, 0);
+		status = CSR_READ_2(sc, SK_Y2_ASF_HCU_CCSR);
+		/* Clear AHB bridge & microcontroller reset. */
+		status &= ~(SK_Y2_ASF_HCU_CSSR_ARB_RST |
+		SK_Y2_ASF_HCU_CSSR_CPU_RST_MODE);
+		/* Clear ASF microcontroller state. */
+		status &= ~SK_Y2_ASF_HCU_CSSR_UC_STATE_MSK;
+		status &= ~SK_Y2_ASF_HCU_CSSR_CPU_CLK_DIVIDE_MSK;
+		CSR_WRITE_2(sc, SK_Y2_ASF_HCU_CCSR, status);
+		CSR_WRITE_4(sc, SK_Y2_CPU_WDOG, 0);
+	} else
+		CSR_WRITE_1(sc, SK_Y2_ASF_CSR, SK_Y2_ASF_RESET);
+	CSR_WRITE_2(sc, SK_CSR, SK_CSR_ASF_OFF);
+
 	CSR_WRITE_1(sc, SK_CSR, SK_CSR_SW_RESET);
 	CSR_WRITE_1(sc, SK_CSR, SK_CSR_MASTER_RESET);
 
@@ -957,10 +974,6 @@ mskc_reset(struct sk_softc *sc)
 	DPRINTFN(2, ("mskc_reset: sk_link_ctrl=%x\n",
 		 CSR_READ_2(sc, SK_LINK_CTRL)));
 
-	/* Disable ASF */
-	CSR_WRITE_1(sc, SK_Y2_ASF_CSR, SK_Y2_ASF_RESET);
-	CSR_WRITE_2(sc, SK_CSR, SK_CSR_ASF_OFF);
-
 	/* Clear I2C IRQ noise */
 	CSR_WRITE_4(sc, SK_I2CHWIRQ, 1);
 
@@ -1096,9 +1109,9 @@ msk_reset(struct sk_if_softc *sc_if)
 {
 	/* GMAC and GPHY Reset */
 	SK_IF_WRITE_4(sc_if, 0, SK_GMAC_CTRL, SK_GMAC_RESET_SET);
-	SK_IF_WRITE_4(sc_if, 0, SK_GPHY_CTRL, SK_GPHY_RESET_SET);
+	SK_IF_WRITE_1(sc_if, 0, SK_GPHY_CTRL, SK_GPHY_RESET_SET);
 	DELAY(1000);
-	SK_IF_WRITE_4(sc_if, 0, SK_GPHY_CTRL, SK_GPHY_RESET_CLEAR);
+	SK_IF_WRITE_1(sc_if, 0, SK_GPHY_CTRL, SK_GPHY_RESET_CLEAR);
 	SK_IF_WRITE_4(sc_if, 0, SK_GMAC_CTRL, SK_GMAC_LOOP_OFF |
 		  SK_GMAC_PAUSE_ON | SK_GMAC_RESET_CLEAR);
 }
@@ -2404,17 +2417,31 @@ msk_init_yukon(struct sk_if_softc *sc_if
 
 	/* Configure RX MAC FIFO */
 	SK_IF_WRITE_1(sc_if, 0, SK_RXMF1_CTRL_TEST, SK_RFCTL_RESET_CLEAR);
-	SK_IF_WRITE_2(sc_if, 0, SK_RXMF1_CTRL_TEST, SK_RFCTL_OPERATION_ON |
-	SK_RFCTL_FIFO_FLUSH_ON);
-
-	/* Increase flush threshold to 64 bytes */
-	SK_IF_WRITE_2(sc_if, 0, SK_RXMF1_FLUSH_THRESHOLD,
-	SK_RFCTL_FIFO_THRESHOLD + 1);
+	v =  SK_RFCTL_OPERATION_ON | SK_RFCTL_FIFO_FLUSH_ON;
+	if ((sc->sk_type == SK_YUKON_EX) || (sc->sk_type == SK_YUKON_FE_P))
+		v |= SK_RFCTL_RX_OVER_ON;
+	SK_IF_WRITE_2(sc_if, 0, SK_RXMF1_CTRL_TEST, v);
+
+	if ((sc->sk_type == SK_YUKON_FE_P) &&
+	(sc->sk_rev == SK_YUKON_FE_P_REV_A0))
+		v = 0x178; /* Magic value */
+	else {
+		/* Increase flush threshold to 64 bytes */
+		v = SK_RFCTL_FIFO_THRESHOLD + 1;
+	}
+	SK_IF_WRITE_2(sc_if, 0, SK_RXMF1_FLUSH_THRESHOLD, v);
 
 	/* Configure TX MAC FIFO */
 	SK_IF_WRITE_1(sc_if, 0, SK_TXMF1_CTRL_TEST, SK_TFCTL_RESET_CLEAR);
 	SK_IF_WRITE_2(sc_if, 0, SK_TXMF1_CTRL_TEST, SK_TFCTL_OPERATION_ON);
 
+	if ((sc->sk_type == SK_YUKON_FE_P) &&
+	(sc->sk_rev == SK_YUKON_FE_P_REV_A0)) {
+		v = SK_IF_READ_2(sc_if, 0, SK_TXMF1_END);
+		v &= ~SK_TXEND_WM_ON;
+		SK_IF_WRITE_2(sc_if, 0, SK_TXMF1_END, v);
+	}	
+
 #if 1
 	SK_YU_WRITE_2(sc_if, YUKON_GPCR, YU_GPCR_TXEN | YU_GPCR_RXEN);
 #endif
@@ -2451,7 +2478,7 @@ msk_init(struct ifnet *ifp)
 	/* Configure transmit arbiter(s) */
 	SK_IF_WRITE_1(sc_if, 0, SK_TXAR1_COUNTERCTL, SK_TXARCTL_ON);
 #if 0
-	SK_TXARCTL_ON | SK_TXARCTL_FSYNC_ON);
+/*	SK_TXARCTL_ON | SK_TXARCTL_FSYNC_ON); */
 #endif
 
 	if (sc->sk_ramsize) {
@@ -2559,6 +2586,13 @@ msk_init(struct ifnet *ifp)
 	SK_IF_WRITE_2(sc_if, 0, SK_RXQ1_Y2_PREF_PUTIDX,
 	sc_if->sk_cdata.sk_rx_prod);
 
+	
+	if ((sc->sk_type == SK_YUKON_EX) || (sc->sk_type == SK_YUKON_SUPR)) {
+		/* Disable flushing of non-ASF packets. */
+		SK_IF_WRITE_4(sc_if, 0, SK_RXMF1_CTRL_TEST,
+		SK_RFCTL_RX_MACSEC_FLUSH_OFF);
+	}
+
 	/* Configure 

CVS commit: src/sys/dev/pci

2019-11-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov 15 12:38:09 UTC 2019

Modified Files:
src/sys/dev/pci: if_msk.c if_skreg.h

Log Message:
 Make Yukon EX, FE+, SUPR stable. The code is mainly taken from FreeBSD.

 At least, this change made my own Yukon EX machine (HP ProBook 4501s) much
stable than before.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/pci/if_msk.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/if_skreg.h

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



CVS commit: src/sys/dev/pci

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:11:36 UTC 2019

Modified Files:
src/sys/dev/pci: if_jmereg.h if_re_pci.c xhci_pci.c

Log Message:
Add D-Link DGE-530T C1 and TP-Link TG-3468 v2.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_jmereg.h
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_re_pci.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/xhci_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/if_jmereg.h
diff -u src/sys/dev/pci/if_jmereg.h:1.3 src/sys/dev/pci/if_jmereg.h:1.4
--- src/sys/dev/pci/if_jmereg.h:1.3	Fri Jan 16 19:56:06 2009
+++ src/sys/dev/pci/if_jmereg.h	Thu Nov 14 09:11:35 2019
@@ -62,6 +62,21 @@
 #define	SPI_SCK_CTRL		0x0002
 #define	SPI_CS_N_CTRL		0x0001
 
+#define	JME_EFUSE_CTL1		0xB8
+#define	EFUSE_CTL1_DATA_MASK	0xF000
+#define	EFUSE_CTL1_EXECUTE	0x0800
+#define	EFUSE_CTL1_CMD_AUTOLOAD	0x0200
+#define	EFUSE_CTL1_CMD_READ	0x0400
+#define	EFUSE_CTL1_CMD_BLOW	0x0600
+#define	EFUSE_CTL1_CMD_MASK	0x0600
+#define	EFUSE_CTL1_AUTOLOAD_ERR	0x0001
+#define	EFUSE_CTL1_BYTE_SEL_MASK	0xFF00
+#define	EFUSE_CTL1_BIT_SEL_MASK	0x0070
+#define	EFUSE_CTL1_AUTOLAOD_DONE	0x0001
+
+#define	JME_EFUSE_CTL2		0xBC
+#define	EFUSE_CTL2_RESET	0x8000
+
 #define	JME_PCI_PHYCFG0		0xC0
 
 #define	JME_PCI_PHYCFG1		0xC4
@@ -757,6 +772,10 @@
 #define	CHIPMODE_MODE_128P_MAC	0x0003
 #define	CHIPMODE_MODE_128P_DBG	0x0002
 #define	CHIPMODE_MODE_128P_PHY	0x
+/* Chip full mask revision. */
+#define	CHIPMODE_REVFM(x)	((x) & 0x0F)
+/* Chip ECO revision. */
+#define	CHIPMODE_REVECO(x)	(((x) >> 4) & 0x0F)
 
 /* Shadow status base address high/low. */
 #define	JME_SHBASE_ADDR_HI	0x48

Index: src/sys/dev/pci/if_re_pci.c
diff -u src/sys/dev/pci/if_re_pci.c:1.49 src/sys/dev/pci/if_re_pci.c:1.50
--- src/sys/dev/pci/if_re_pci.c:1.49	Tue Nov 13 20:12:45 2018
+++ src/sys/dev/pci/if_re_pci.c	Thu Nov 14 09:11:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_re_pci.c,v 1.49 2018/11/13 20:12:45 jdolecek Exp $	*/
+/*	$NetBSD: if_re_pci.c,v 1.50 2019/11/14 09:11:35 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_re_pci.c,v 1.49 2018/11/13 20:12:45 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_re_pci.c,v 1.50 2019/11/14 09:11:35 msaitoh Exp $");
 
 #include 
 
@@ -99,6 +99,9 @@ static const struct rtk_type re_devs[] =
 	{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8168,
 	RTK_8168,
 	"RealTek 8168/8111 PCIe Gigabit Ethernet" },
+	{ PCI_VENDOR_NCUBE, PCI_PRODUCT_NCUBE_TG3648,
+	RTK_8168,
+	"TP-Link TG-3468 v2 (RTL8168) Gigabit Ethernet" },
 	{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169,
 	RTK_8169,
 	"RealTek 8169/8110 Gigabit Ethernet" },
@@ -111,6 +114,9 @@ static const struct rtk_type re_devs[] =
 	{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE528T,
 	RTK_8169,
 	"D-Link DGE-528T Gigabit Ethernet" },
+	{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE530T_C1,
+	RTK_8169,
+	"D-Link DGE-530T C1 Gigabit Ethernet" },
 	{ PCI_VENDOR_USR2, PCI_PRODUCT_USR2_USR997902,
 	RTK_8169,
 	"US Robotics (3Com) USR997902 Gigabit Ethernet" },

Index: src/sys/dev/pci/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.21 src/sys/dev/pci/xhci_pci.c:1.22
--- src/sys/dev/pci/xhci_pci.c:1.21	Wed Jan 23 06:56:19 2019
+++ src/sys/dev/pci/xhci_pci.c	Thu Nov 14 09:11:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.21 2019/01/23 06:56:19 msaitoh Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.22 2019/11/14 09:11:35 msaitoh Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.21 2019/01/23 06:56:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.22 2019/11/14 09:11:35 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -203,10 +203,17 @@ xhci_pci_attach(device_t parent, device_
 		   csr | PCI_COMMAND_MASTER_ENABLE);
 
 	/* Allocate and establish the interrupt. */
+#if 0
 	if (pci_intr_alloc(pa, >sc_pihp, NULL, 0)) {
 		aprint_error_dev(self, "can't allocate handler\n");
 		goto fail;
 	}
+#else
+	if (pci_intx_alloc(pa, >sc_pihp)) {
+		aprint_error_dev(self, "can't allocate handler\n");
+		goto fail;
+	}
+#endif
 	intrstr = pci_intr_string(pc, psc->sc_pihp[0], intrbuf,
 	sizeof(intrbuf));
 	psc->sc_ih = pci_intr_establish_xname(pc, psc->sc_pihp[0], IPL_USB,



CVS commit: src/sys/dev/pci

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:11:36 UTC 2019

Modified Files:
src/sys/dev/pci: if_jmereg.h if_re_pci.c xhci_pci.c

Log Message:
Add D-Link DGE-530T C1 and TP-Link TG-3468 v2.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_jmereg.h
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_re_pci.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/xhci_pci.c

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



CVS commit: src/sys/dev/pci

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:15:12 UTC 2019

Modified Files:
src/sys/dev/pci: if_jmereg.h xhci_pci.c

Log Message:
 Revert previous. Sorry.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_jmereg.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/xhci_pci.c

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



CVS commit: src/sys/dev/pci

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:15:12 UTC 2019

Modified Files:
src/sys/dev/pci: if_jmereg.h xhci_pci.c

Log Message:
 Revert previous. Sorry.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_jmereg.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/xhci_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/if_jmereg.h
diff -u src/sys/dev/pci/if_jmereg.h:1.4 src/sys/dev/pci/if_jmereg.h:1.5
--- src/sys/dev/pci/if_jmereg.h:1.4	Thu Nov 14 09:11:35 2019
+++ src/sys/dev/pci/if_jmereg.h	Thu Nov 14 09:15:12 2019
@@ -62,21 +62,6 @@
 #define	SPI_SCK_CTRL		0x0002
 #define	SPI_CS_N_CTRL		0x0001
 
-#define	JME_EFUSE_CTL1		0xB8
-#define	EFUSE_CTL1_DATA_MASK	0xF000
-#define	EFUSE_CTL1_EXECUTE	0x0800
-#define	EFUSE_CTL1_CMD_AUTOLOAD	0x0200
-#define	EFUSE_CTL1_CMD_READ	0x0400
-#define	EFUSE_CTL1_CMD_BLOW	0x0600
-#define	EFUSE_CTL1_CMD_MASK	0x0600
-#define	EFUSE_CTL1_AUTOLOAD_ERR	0x0001
-#define	EFUSE_CTL1_BYTE_SEL_MASK	0xFF00
-#define	EFUSE_CTL1_BIT_SEL_MASK	0x0070
-#define	EFUSE_CTL1_AUTOLAOD_DONE	0x0001
-
-#define	JME_EFUSE_CTL2		0xBC
-#define	EFUSE_CTL2_RESET	0x8000
-
 #define	JME_PCI_PHYCFG0		0xC0
 
 #define	JME_PCI_PHYCFG1		0xC4
@@ -772,10 +757,6 @@
 #define	CHIPMODE_MODE_128P_MAC	0x0003
 #define	CHIPMODE_MODE_128P_DBG	0x0002
 #define	CHIPMODE_MODE_128P_PHY	0x
-/* Chip full mask revision. */
-#define	CHIPMODE_REVFM(x)	((x) & 0x0F)
-/* Chip ECO revision. */
-#define	CHIPMODE_REVECO(x)	(((x) >> 4) & 0x0F)
 
 /* Shadow status base address high/low. */
 #define	JME_SHBASE_ADDR_HI	0x48

Index: src/sys/dev/pci/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.22 src/sys/dev/pci/xhci_pci.c:1.23
--- src/sys/dev/pci/xhci_pci.c:1.22	Thu Nov 14 09:11:35 2019
+++ src/sys/dev/pci/xhci_pci.c	Thu Nov 14 09:15:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.22 2019/11/14 09:11:35 msaitoh Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.23 2019/11/14 09:15:12 msaitoh Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.22 2019/11/14 09:11:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.23 2019/11/14 09:15:12 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -203,17 +203,10 @@ xhci_pci_attach(device_t parent, device_
 		   csr | PCI_COMMAND_MASTER_ENABLE);
 
 	/* Allocate and establish the interrupt. */
-#if 0
 	if (pci_intr_alloc(pa, >sc_pihp, NULL, 0)) {
 		aprint_error_dev(self, "can't allocate handler\n");
 		goto fail;
 	}
-#else
-	if (pci_intx_alloc(pa, >sc_pihp)) {
-		aprint_error_dev(self, "can't allocate handler\n");
-		goto fail;
-	}
-#endif
 	intrstr = pci_intr_string(pc, psc->sc_pihp[0], intrbuf,
 	sizeof(intrbuf));
 	psc->sc_ih = pci_intr_establish_xname(pc, psc->sc_pihp[0], IPL_USB,



CVS commit: src/sys/dev/pci

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:10:41 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add D-Link DGE-530T C1 and TP-Link TG-3468 v2.


To generate a diff of this commit:
cvs rdiff -u -r1.1390 -r1.1391 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.1390 src/sys/dev/pci/pcidevs:1.1391
--- src/sys/dev/pci/pcidevs:1.1390	Fri Nov  8 04:37:45 2019
+++ src/sys/dev/pci/pcidevs	Thu Nov 14 09:10:41 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1390 2019/11/08 04:37:45 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1391 2019/11/14 09:10:41 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2513,6 +2513,7 @@ product DLINK DL4000		0x4000	DL-4000 Gig
 product DLINK DGE550SX		0x4001	DGE-550SX
 product DLINK DFE520TX		0x4200	DFE-520TX 10/100 Ethernet
 product DLINK DGE528T		0x4300	DGE-528T Gigabit Ethernet
+product DLINK DGE530T_C1	0x4302	DGE-530T C1
 product DLINK DGE560T		0x4b00	DGE-560T Gigabit Ethernet
 product DLINK DGE560T_2		0x4b01	DGE-560T_2 Gigabit Ethernet
 product DLINK DGE560SX		0x4b02	DGE-560SX
@@ -5965,6 +5966,9 @@ product MYRICOM MYRINET	0x8043	Myrinet
 /* Myson-Century Technology products */
 product MYSON MTD803	0x0803	MTD803 3-in-1 Fast Ethernet Controller
 
+/* Ncube products */
+product NCUBE TG3648	0x8168	TP-Link TG-3468 v2 Gigabit Ethernet
+
 /* National Datacomm products */
 product NDC NCP130		0x0130 NCP130 Wireless NIC
 product NDC NCP130A2		0x0131 NCP130 rev A2 Wireless NIC



CVS commit: src/sys/dev/pci

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:11:06 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1378 -r1.1379 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1377 -r1.1378 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.



CVS commit: src/sys/dev/pci

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:10:41 UTC 2019

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add D-Link DGE-530T C1 and TP-Link TG-3468 v2.


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

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



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:06:21 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
- Use auto-negotiation when forcing 1000BASE-T.
- Add XXX comment for strange pause setting code. I suspect this is wrong.
- On my environments, 1000BASE-T half duplex doesn't work, so we might remove
  IFM_1000T_HDX from this device in future.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/ipgphy.c

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

Modified files:

Index: src/sys/dev/mii/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.3 src/sys/dev/mii/ipgphy.c:1.4
--- src/sys/dev/mii/ipgphy.c:1.3	Thu Nov 14 09:00:23 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 14 09:06:21 2019
@@ -32,7 +32,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.3 2019/11/14 09:00:23 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.4 2019/11/14 09:06:21 msaitoh Exp $");
 
 #include 
 #include 
@@ -60,7 +60,7 @@ CFATTACH_DECL_NEW(ipgphy, sizeof(struct 
 
 static int	ipgphy_service(struct mii_softc *, struct mii_data *, int);
 static void	ipgphy_status(struct mii_softc *);
-static int	ipgphy_mii_phy_auto(struct mii_softc *);
+static int	ipgphy_mii_phy_auto(struct mii_softc *, u_int);
 static void	ipgphy_load_dspcode(struct mii_softc *);
 static void	ipgphy_reset(struct mii_softc *);
 
@@ -126,7 +126,7 @@ static int
 ipgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
 {
 	struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
-	uint16_t gig, reg, speed;
+	uint16_t reg, speed;
 
 	switch (cmd) {
 	case MII_POLLSTAT:
@@ -154,16 +154,13 @@ ipgphy_service(struct mii_softc *sc, str
 
 		switch (IFM_SUBTYPE(ife->ifm_media)) {
 		case IFM_AUTO:
-			(void)ipgphy_mii_phy_auto(sc);
-			goto done;
-			break;
-
 		case IFM_1000_T:
 			/*
-			 * XXX
-			 * Manual 1000baseT setting doesn't seem to work.
+			 * This device is required to do auto negotiation
+			 * on 1000BASE-T.
 			 */
-			speed = BMCR_S1000;
+			(void)ipgphy_mii_phy_auto(sc, ife->ifm_media);
+			goto done;
 			break;
 
 		case IFM_100_TX:
@@ -178,26 +175,11 @@ ipgphy_service(struct mii_softc *sc, str
 			return EINVAL;
 		}
 
-		if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) {
+		if ((ife->ifm_media & IFM_FDX) != 0)
 			speed |= BMCR_FDX;
-			gig = GTCR_ADV_1000TFDX;
-		} else
-			gig = GTCR_ADV_1000THDX;
 
 		PHY_WRITE(sc, MII_100T2CR, 0);
 		PHY_WRITE(sc, MII_BMCR, speed);
-
-		if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T)
-			break;
-
-		PHY_WRITE(sc, MII_100T2CR, gig);
-		PHY_WRITE(sc, MII_BMCR, speed);
-
-		if (mii->mii_media.ifm_media & IFM_ETH_MASTER)
-			gig |= GTCR_MAN_MS | GTCR_ADV_MS;
-
-		PHY_WRITE(sc, MII_100T2CR, gig);
-
 done:
 		break;
 
@@ -211,7 +193,8 @@ done:
 			return 0;
 
 		/* Only used for autonegotiation. */
-		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
+		if ((IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) &&
+		(IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T)) {
 			sc->mii_ticks = 0;
 			break;
 		}
@@ -242,7 +225,7 @@ done:
 			break;
 
 		sc->mii_ticks = 0;
-		ipgphy_mii_phy_auto(sc);
+		ipgphy_mii_phy_auto(sc, ife->ifm_media);
 		break;
 	}
 
@@ -320,26 +303,36 @@ ipgphy_status(struct mii_softc *sc)
 }
 
 static int
-ipgphy_mii_phy_auto(struct mii_softc *sc)
+ipgphy_mii_phy_auto(struct mii_softc *sc, u_int media)
 {
 	uint16_t reg = 0;
+	u_int subtype = IFM_SUBTYPE(media);
 
+	/* XXX Is it requreid ? */
 	if (sc->mii_mpd_model == MII_MODEL_xxICPLUS_IP1001) {
 		PHY_READ(sc, MII_ANAR, );
 		reg &= ~(ANAR_PAUSE_SYM | ANAR_PAUSE_ASYM);
 		reg |= ANAR_NP;
 	}
 
-	reg |= ANAR_10 | ANAR_10_FD | ANAR_TX | ANAR_TX_FD;
+	if (subtype == IFM_AUTO)
+		reg |= ANAR_10 | ANAR_10_FD | ANAR_TX | ANAR_TX_FD;
 
 	if (sc->mii_flags & MIIF_DOPAUSE)
 		reg |= ANAR_PAUSE_SYM | ANAR_PAUSE_ASYM;
 
 	PHY_WRITE(sc, MII_ANAR, reg | ANAR_CSMA);
 
-	reg = GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX;
-	if (sc->mii_mpd_model != MII_MODEL_xxICPLUS_IP1001)
-		reg |= GTCR_ADV_MS;
+	if (subtype == IFM_AUTO)
+		reg = GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX;
+	else if (subtype == IFM_1000_T) {
+		if ((media & IFM_FDX) != 0)
+			reg = GTCR_ADV_1000TFDX;
+		else
+			reg = GTCR_ADV_1000THDX;
+	} else
+		reg = 0;
+
 	PHY_WRITE(sc, MII_100T2CR, reg);
 
 	PHY_WRITE(sc, MII_BMCR, BMCR_FDX | BMCR_AUTOEN | BMCR_STARTNEG);



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:06:21 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
- Use auto-negotiation when forcing 1000BASE-T.
- Add XXX comment for strange pause setting code. I suspect this is wrong.
- On my environments, 1000BASE-T half duplex doesn't work, so we might remove
  IFM_1000T_HDX from this device in future.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/ipgphy.c

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



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:00:23 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 STGE_PhyCtrl is not PHY register but MAC register, so use ukphy_status()
for IP1000A device.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/ipgphy.c

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

Modified files:

Index: src/sys/dev/mii/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.2 src/sys/dev/mii/ipgphy.c:1.3
--- src/sys/dev/mii/ipgphy.c:1.2	Thu Nov 14 08:52:34 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 14 09:00:23 2019
@@ -32,7 +32,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.2 2019/11/14 08:52:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.3 2019/11/14 09:00:23 msaitoh Exp $");
 
 #include 
 #include 
@@ -261,6 +261,12 @@ ipgphy_status(struct mii_softc *sc)
 	struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
 	uint16_t bmsr, bmcr, stat, gtsr;
 
+	/* For IP1000A, use generic way */
+	if (sc->mii_mpd_model == MII_MODEL_xxICPLUS_IP1000A) {
+		ukphy_status(sc);
+		return;
+	}
+
 	mii->mii_media_status = IFM_AVALID;
 	mii->mii_media_active = IFM_ETHER;
 
@@ -280,53 +286,27 @@ ipgphy_status(struct mii_softc *sc)
 			return;
 		}
 
-		if (sc->mii_mpd_model == MII_MODEL_xxICPLUS_IP1001) {
-			PHY_READ(sc, IPGPHY_LSR, );
-			switch (stat & IPGPHY_LSR_SPEED_MASK) {
-			case IPGPHY_LSR_SPEED_10:
-mii->mii_media_active |= IFM_10_T;
-break;
-			case IPGPHY_LSR_SPEED_100:
-mii->mii_media_active |= IFM_100_TX;
-break;
-			case IPGPHY_LSR_SPEED_1000:
-mii->mii_media_active |= IFM_1000_T;
-break;
-			default:
-mii->mii_media_active |= IFM_NONE;
-return;
-			}
-
-			if (stat & IPGPHY_LSR_FULL_DUPLEX)
-mii->mii_media_active |= IFM_FDX;
-			else
-mii->mii_media_active |= IFM_HDX;
-		} else {
-			PHY_READ(sc, STGE_PhyCtrl, );
-			switch (PC_LinkSpeed(stat)) {
-			case PC_LinkSpeed_Down:
-mii->mii_media_active |= IFM_NONE;
-return;
-			case PC_LinkSpeed_10:
-mii->mii_media_active |= IFM_10_T;
-break;
-			case PC_LinkSpeed_100:
-mii->mii_media_active |= IFM_100_TX;
-break;
-			case PC_LinkSpeed_1000:
-mii->mii_media_active |= IFM_1000_T;
-break;
-			default:
-mii->mii_media_active |= IFM_NONE;
-return;
-			}
-
-			if (stat & PC_PhyDuplexStatus)
-mii->mii_media_active |= IFM_FDX;
-			else
-mii->mii_media_active |= IFM_HDX;
+		PHY_READ(sc, IPGPHY_LSR, );
+		switch (stat & IPGPHY_LSR_SPEED_MASK) {
+		case IPGPHY_LSR_SPEED_10:
+			mii->mii_media_active |= IFM_10_T;
+			break;
+		case IPGPHY_LSR_SPEED_100:
+			mii->mii_media_active |= IFM_100_TX;
+			break;
+		case IPGPHY_LSR_SPEED_1000:
+			mii->mii_media_active |= IFM_1000_T;
+			break;
+		default:
+			mii->mii_media_active |= IFM_NONE;
+			return;
 		}
 
+		if (stat & IPGPHY_LSR_FULL_DUPLEX)
+			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
+
 		if (mii->mii_media_active & IFM_FDX)
 			mii->mii_media_active |= mii_phy_flowstatus(sc);
 



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:00:23 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 STGE_PhyCtrl is not PHY register but MAC register, so use ukphy_status()
for IP1000A device.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/ipgphy.c

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



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 08:52:34 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/ipgphy.c

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



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 08:52:34 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/ipgphy.c

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

Modified files:

Index: src/sys/dev/mii/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.1 src/sys/dev/mii/ipgphy.c:1.2
--- src/sys/dev/mii/ipgphy.c:1.1	Mon Oct  7 11:53:40 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 14 08:52:34 2019
@@ -32,7 +32,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.1 2019/10/07 11:53:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.2 2019/11/14 08:52:34 msaitoh Exp $");
 
 #include 
 #include 
@@ -79,9 +79,9 @@ ipgphy_match(device_t parent, cfdata_t m
 {
 	struct mii_attach_args *ma = aux;
 
-	if (mii_phy_match(ma, ipgphys) != NULL) {
+	if (mii_phy_match(ma, ipgphys) != NULL)
 		return 10;
-	}
+
 	return 0;
 }
 
@@ -130,9 +130,7 @@ ipgphy_service(struct mii_softc *sc, str
 
 	switch (cmd) {
 	case MII_POLLSTAT:
-		/*
-		 * If we're not polling our PHY instance, just return.
-		 */
+		/* If we're not polling our PHY instance, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 		break;
@@ -148,9 +146,7 @@ ipgphy_service(struct mii_softc *sc, str
 			return 0;
 		}
 
-		/*
-		 * If the interface is not up, don't do anything.
-		 */
+		/* If the interface is not up, don't do anything. */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			break;
 
@@ -206,21 +202,15 @@ done:
 		break;
 
 	case MII_TICK:
-		/*
-		 * If we're not currently selected, just return.
-		 */
+		/* If we're not currently selected, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 
-		/*
-		 * Is the interface even up?
-		 */
+		/* Is the interface even up? */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			return 0;
 
-		/*
-		 * Only used for autonegotiation.
-		 */
+		/* Only used for autonegotiation. */
 		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
 			sc->mii_ticks = 0;
 			break;
@@ -247,9 +237,7 @@ done:
 		if (sc->mii_ticks++ == 0)
 			break;
 
-		/*
-		 * Only retry autonegotiation every mii_anegticks seconds.
-		 */
+		/* Only retry autonegotiation every mii_anegticks seconds. */
 		if (sc->mii_ticks <= sc->mii_anegticks)
 			break;
 
@@ -401,7 +389,7 @@ ipgphy_reset(struct mii_softc *sc)
 
 	mii_phy_reset(sc);
 
-	/* clear autoneg/full-duplex as we don't want it after reset */
+	/* Clear autoneg/full-duplex as we don't want it after reset */
 	PHY_READ(sc, MII_BMCR, );
 	reg &= ~(BMCR_AUTOEN | BMCR_FDX);
 	PHY_WRITE(sc, MII_BMCR, reg);



CVS commit: src/sys/net

2019-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 04:14:30 UTC 2019

Modified Files:
src/sys/net: if_loop.c

Log Message:
 Fix comment.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/net/if_loop.c

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



CVS commit: src/sys/net

2019-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 04:14:30 UTC 2019

Modified Files:
src/sys/net: if_loop.c

Log Message:
 Fix comment.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/net/if_loop.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/net/if_loop.c
diff -u src/sys/net/if_loop.c:1.108 src/sys/net/if_loop.c:1.109
--- src/sys/net/if_loop.c:1.108	Mon Nov 11 08:12:35 2019
+++ src/sys/net/if_loop.c	Thu Nov 14 04:14:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_loop.c,v 1.108 2019/11/11 08:12:35 msaitoh Exp $	*/
+/*	$NetBSD: if_loop.c,v 1.109 2019/11/14 04:14:30 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.108 2019/11/11 08:12:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.109 2019/11/14 04:14:30 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -341,7 +341,7 @@ looutput(struct ifnet *ifp, struct mbuf 
 			m->m_pkthdr.csum_flags = 0;
 		} else {
 			/*
-			 * Do nothing. Pass M_CSUM_IPv4 and M_CSUM_UDPv4 as
+			 * Do nothing. Pass M_CSUM_UDPv6 as
 			 * they are to tell those are calculated and good.
 			 */
 		}



CVS commit: src/sys/dev/mii

2019-11-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 12 14:07:09 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphyreg.h

Log Message:
- Define IPGPHY_SCR's address.
- Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/ipgphyreg.h

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



CVS commit: src/sys/dev/mii

2019-11-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 12 14:07:09 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphyreg.h

Log Message:
- Define IPGPHY_SCR's address.
- Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/ipgphyreg.h

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

Modified files:

Index: src/sys/dev/mii/ipgphyreg.h
diff -u src/sys/dev/mii/ipgphyreg.h:1.1 src/sys/dev/mii/ipgphyreg.h:1.2
--- src/sys/dev/mii/ipgphyreg.h:1.1	Mon Oct  7 11:53:40 2019
+++ src/sys/dev/mii/ipgphyreg.h	Tue Nov 12 14:07:09 2019
@@ -36,48 +36,48 @@
  */
 
 /* PHY specific control & status register. IP1001 only. */
-#define IPGPHY_SCSR			0x10
-#define IPGPHY_SCSR_RXPHASE_SEL	0x0001
-#define IPGPHY_SCSR_TXPHASE_SEL	0x0002
+#define IPGPHY_SCSR		0x10
+#define IPGPHY_SCSR_RXPHASE_SEL		0x0001
+#define IPGPHY_SCSR_TXPHASE_SEL		0x0002
 #define IPGPHY_SCSR_REPEATOR_MODE	0x0004
 #define IPGPHY_SCSR_RESERVED1_DEF	0x0008
 #define IPGPHY_SCSR_RXCLK_DRV_MASK	0x0060
 #define IPGPHY_SCSR_RXCLK_DRV_DEF	0x0040
 #define IPGPHY_SCSR_RXD_DRV_MASK	0x0180
-#define IPGPHY_SCSR_RXD_DRV_DEF	0x0100
-#define IPGPHY_SCSR_JABBER_ENB	0x0200
+#define IPGPHY_SCSR_RXD_DRV_DEF		0x0100
+#define IPGPHY_SCSR_JABBER_ENB		0x0200
 #define IPGPHY_SCSR_HEART_BEAT_ENB	0x0400
 #define IPGPHY_SCSR_DOWNSHIFT_ENB	0x0800
 #define IPGPHY_SCSR_RESERVED2_DEF	0x1000
-#define IPGPHY_SCSR_LED_DRV_4MA	0x
-#define IPGPHY_SCSR_LED_DRV_8MA	0x2000
+#define IPGPHY_SCSR_LED_DRV_4MA		0x
+#define IPGPHY_SCSR_LED_DRV_8MA		0x2000
 #define IPGPHY_SCSR_LED_MODE_MASK	0xC000
 #define IPGPHY_SCSR_LED_MODE_DEF	0x
 
 /* PHY link status register. IP1001 only. */
-#define IPGPHY_LSR			0x11
-#define IPGPHY_LSR_JABBER_DET	0x0200
+#define IPGPHY_LSR		0x11
+#define IPGPHY_LSR_JABBER_DET		0x0200
 #define IPGPHY_LSR_APS_SLEEP		0x0400
-#define IPGPHY_LSR_MDIX		0x0800
-#define IPGPHY_LSR_FULL_DUPLEX	0x1000
+#define IPGPHY_LSR_MDIX			0x0800
+#define IPGPHY_LSR_FULL_DUPLEX		0x1000
 #define IPGPHY_LSR_SPEED_10		0x
 #define IPGPHY_LSR_SPEED_100		0x2000
-#define IPGPHY_LSR_SPEED_1000	0x4000
-#define IPGPHY_LSR_SPEED_MASK	0x6000
+#define IPGPHY_LSR_SPEED_1000		0x4000
+#define IPGPHY_LSR_SPEED_MASK		0x6000
 #define IPGPHY_LSR_LINKUP		0x8000
 
 /* PHY specific control register 2. IP1001 only. */
-#define IPGPHY_SCR
+#define IPGPHY_SCR		0x14
 #define IPGPHY_SCR_SEW_RATE_MASK	0x0003
-#define IPGPHY_SCR_SEW_RATE_DEF	0x0003
-#define IPGPHY_SCR_AUTO_XOVER	0x0004
+#define IPGPHY_SCR_SEW_RATE_DEF		0x0003
+#define IPGPHY_SCR_AUTO_XOVER		0x0004
 #define IPGPHY_SCR_SPEED_10_100_ENB	0x0040
 #define IPGPHY_SCR_FIFO_LATENCY_2	0x
 #define IPGPHY_SCR_FIFO_LATENCY_3	0x0080
 #define IPGPHY_SCR_FIFO_LATENCY_4	0x0100
 #define IPGPHY_SCR_FIFO_LATENCY_5	0x0180
 #define IPGPHY_SCR_MDIX_ENB		0x0200
-#define IPGPHY_SCR_RESERVED_DEF	0x0400
+#define IPGPHY_SCR_RESERVED_DEF		0x0400
 #define IPGPHY_SCR_APS_ON		0x0800
 
 #endif /* _DEV_MII_IPGPHYREG_H_ */



CVS commit: src/sys

2019-11-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 12 13:17:44 UTC 2019

Modified Files:
src/sys/arch/amiga/dev: if_qn.c zssc.c
src/sys/arch/mac68k/obio: iwm_fd.c
src/sys/arch/mvme68k/dev: wdsc.c
src/sys/arch/next68k/dev: nextdisplay.c
src/sys/dev/gpib: ct.c mt.c ppi.c
src/sys/dev/isa: if_iy.c mcd.c tcic2_isa.c
src/sys/dev/pci: neo.c
src/sys/dev/pcmcia: if_tr_pcmcia.c
src/sys/dev/sbus: sio16.c

Log Message:
 Add missing initialization of sc_dev.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/amiga/dev/if_qn.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amiga/dev/zssc.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/mac68k/obio/iwm_fd.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mvme68k/dev/wdsc.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/next68k/dev/nextdisplay.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/gpib/ct.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/gpib/mt.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/gpib/ppi.c
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/isa/if_iy.c
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/isa/mcd.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/isa/tcic2_isa.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/neo.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pcmcia/if_tr_pcmcia.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/sbus/sio16.c

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



  1   2   3   4   5   6   7   8   9   >