Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2007 10:27:27 GMT
From:      Paolo Pisati <piso@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 112929 for review
Message-ID:  <200701151027.l0FARRTY058071@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112929

Change 112929 by piso@piso_newluxor on 2007/01/15 10:27:06

	IFC@112928

Affected files ...

.. //depot/projects/soc2006/intr_filter/amd64/include/setjmp.h#2 integrate
.. //depot/projects/soc2006/intr_filter/amd64/linux32/linux32_machdep.c#7 integrate
.. //depot/projects/soc2006/intr_filter/boot/forth/loader.conf#6 integrate
.. //depot/projects/soc2006/intr_filter/compat/linux/linux_ipc.c#6 integrate
.. //depot/projects/soc2006/intr_filter/compat/linux/linux_mib.c#4 integrate
.. //depot/projects/soc2006/intr_filter/dev/ath/ath_rate/sample/sample.c#3 integrate
.. //depot/projects/soc2006/intr_filter/dev/ath/ath_rate/sample/sample.h#4 integrate
.. //depot/projects/soc2006/intr_filter/dev/ath/if_ath.c#11 integrate
.. //depot/projects/soc2006/intr_filter/dev/ath/if_athvar.h#9 integrate
.. //depot/projects/soc2006/intr_filter/dev/bce/if_bce.c#10 integrate
.. //depot/projects/soc2006/intr_filter/dev/cy/cy_isa.c#5 integrate
.. //depot/projects/soc2006/intr_filter/dev/fb/creatorreg.h#2 integrate
.. //depot/projects/soc2006/intr_filter/dev/fb/gallant12x22.c#2 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/acphy.c#4 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/acphyreg.h#2 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/amphy.c#4 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/exphy.c#3 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/inphy.c#4 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/lxtphy.c#5 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/mii_physubr.c#5 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/miivar.h#4 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/nsphy.c#5 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/rlphy.c#5 integrate
.. //depot/projects/soc2006/intr_filter/dev/mii/ruephy.c#3 integrate
.. //depot/projects/soc2006/intr_filter/dev/pci/pci.c#8 integrate
.. //depot/projects/soc2006/intr_filter/dev/pci/pci_pci.c#4 integrate
.. //depot/projects/soc2006/intr_filter/dev/pci/pcib_private.h#4 integrate
.. //depot/projects/soc2006/intr_filter/dev/sound/pci/hda/hdac.c#7 integrate
.. //depot/projects/soc2006/intr_filter/i386/i386/machdep.c#9 integrate
.. //depot/projects/soc2006/intr_filter/i386/include/setjmp.h#2 integrate
.. //depot/projects/soc2006/intr_filter/i386/linux/linux_machdep.c#6 integrate
.. //depot/projects/soc2006/intr_filter/ia64/include/exec.h#2 integrate
.. //depot/projects/soc2006/intr_filter/ia64/include/floatingpoint.h#2 integrate
.. //depot/projects/soc2006/intr_filter/ia64/include/reloc.h#2 integrate
.. //depot/projects/soc2006/intr_filter/kern/kern_acl.c#4 integrate
.. //depot/projects/soc2006/intr_filter/kern/kern_ntptime.c#3 integrate
.. //depot/projects/soc2006/intr_filter/net80211/_ieee80211.h#3 integrate
.. //depot/projects/soc2006/intr_filter/net80211/ieee80211.c#6 integrate
.. //depot/projects/soc2006/intr_filter/net80211/ieee80211_node.c#4 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/aarp.c#4 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/aarp.h#2 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/at.h#2 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/at_extern.h#2 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/at_proto.c#2 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/at_rmx.c#2 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/at_var.h#2 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/ddp.h#2 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/ddp_input.c#4 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/ddp_output.c#3 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/ddp_pcb.c#5 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/ddp_pcb.h#3 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/ddp_usrreq.c#4 integrate
.. //depot/projects/soc2006/intr_filter/netatalk/ddp_var.h#2 integrate
.. //depot/projects/soc2006/intr_filter/netgraph/ng_deflate.c#3 integrate
.. //depot/projects/soc2006/intr_filter/netgraph/ng_pred1.c#2 integrate
.. //depot/projects/soc2006/intr_filter/netgraph/ng_tcpmss.c#2 integrate
.. //depot/projects/soc2006/intr_filter/netinet/if_ether.c#5 integrate
.. //depot/projects/soc2006/intr_filter/netinet/ip.h#2 integrate
.. //depot/projects/soc2006/intr_filter/netinet6/esp_aesctr.c#3 integrate
.. //depot/projects/soc2006/intr_filter/netinet6/in6_cksum.c#4 integrate
.. //depot/projects/soc2006/intr_filter/pci/if_pcn.c#4 integrate
.. //depot/projects/soc2006/intr_filter/powerpc/include/reloc.h#2 integrate
.. //depot/projects/soc2006/intr_filter/powerpc/powerpc/cpu.c#2 integrate
.. //depot/projects/soc2006/intr_filter/powerpc/powerpc/machdep.c#5 integrate
.. //depot/projects/soc2006/intr_filter/sparc64/include/ofw_nexus.h#2 integrate
.. //depot/projects/soc2006/intr_filter/sparc64/include/reloc.h#2 integrate
.. //depot/projects/soc2006/intr_filter/sparc64/include/setjmp.h#2 integrate
.. //depot/projects/soc2006/intr_filter/sun4v/include/reloc.h#3 integrate
.. //depot/projects/soc2006/intr_filter/sun4v/include/setjmp.h#3 integrate

Differences ...

==== //depot/projects/soc2006/intr_filter/amd64/include/setjmp.h#2 (text+ko) ====

@@ -10,10 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by John Birrell.
- * 4. Neither the name of the author nor the names of any co-contributors
+ * 3. Neither the name of the author nor the names of any co-contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -29,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/setjmp.h,v 1.9 2003/06/02 21:49:35 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/setjmp.h,v 1.10 2007/01/12 07:24:06 imp Exp $
  */
 
 #ifndef _MACHINE_SETJMP_H_

==== //depot/projects/soc2006/intr_filter/amd64/linux32/linux32_machdep.c#7 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.25 2007/01/07 19:00:38 netchild Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.26 2007/01/14 16:20:37 netchild Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -497,6 +497,7 @@
 		return (error);
 	/* wait for the children to exit, ie. emulate vfork */
 	PROC_LOCK(p2);
+	p2->p_flag |= P_PPWAIT;
 	while (p2->p_flag & P_PPWAIT)
 	   	msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
 	PROC_UNLOCK(p2);

==== //depot/projects/soc2006/intr_filter/boot/forth/loader.conf#6 (text+ko) ====

@@ -6,7 +6,7 @@
 #
 # All arguments must be in double quotes.
 #
-# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.114 2006/12/13 02:48:22 yongari Exp $
+# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.117 2007/01/14 13:55:43 maxim Exp $
 
 ##############################################################
 ###  Basic configuration options  ############################
@@ -147,13 +147,13 @@
 				# ggatec(8), ggated(8), ggatel(8))
 geom_label_load="NO"		# File system labels (see glabel(8))
 geom_md_load="NO"		# Memory disk driver (vnode/swap/malloc) (see
+				# md(4), mdconfig(8))
 geom_mirror_load="NO"		# RAID1 disk driver (see gmirror(8))
 geom_nop_load="NO"		# Transparent disk driver (see gnop(8))
 geom_raid3_load="NO"		# RAID3 disk driver (see graid3(8))
 geom_shsec_load="NO"		# Shared secret disk driver (see gshsec(8))
 geom_stripe_load="NO"		# RAID0 disk driver (see gstripe(8))
 geom_uzip_load="NO"		# Compressed disk images driver (see mkuzip(8))
-				# md(4), mdconfig(8))
 geom_vinum_load="NO"		# Concatenated/mirror/raid driver (see vinum(4))
 
 
@@ -183,7 +183,8 @@
 ##############################################################
 
 if_disc_load="NO"		# Discard device
-if_ef_load="NO"			# pseudo-device providing support for multiple ethernet frame types
+if_ef_load="NO"			# pseudo-device providing support for multiple
+				# ethernet frame types
 if_faith_load="NO"		# IPv6-to-IPv4 TCP relay capturing interface
 if_gif_load="NO"		# generic tunnel interface
 if_gre_load="NO"		# encapsulating network device
@@ -217,21 +218,25 @@
 if_cue_load="NO"		# CATC USB-EL1210A USB Ethernet
 if_dc_load="NO"			# DEC/Intel 21143 and various workalikes
 if_de_load="NO"			# DEC DC21x4x Ethernet
-if_ed_load="NO"			# National Semiconductor DS8390/WD83C690 Ethernet
+if_ed_load="NO"			# National Semiconductor DS8390/WD83C690
+				# Ethernet
 if_em_load="NO"			# Intel(R) PRO/1000 Gigabit Ethernet
 if_en_load="NO"			# Midway-based ATM interfaces
 if_ep_load="NO"			# 3Com Etherlink III (3c5x9)
 if_ex_load="NO"			# Intel EtherExpress Pro/10 Ethernet
-if_fe_load="NO"			# Fujitsu MB86960A/MB86965A based Ethernet adapters
+if_fe_load="NO"			# Fujitsu MB86960A/MB86965A based Ethernet
+				# adapters
 if_fxp_load="NO"		# Intel EtherExpress PRO/100B (82557, 82558)
 if_gem_load="NO"		# Sun GEM/Sun ERI/Apple GMAC
 if_hme_load="NO"		# Sun Microelectronics STP2002-STQ Ethernet
 if_ie_load="NO"			# Intel 82586
 if_ipw_load="NO"		# Intel PRO/Wireless 2100 wireless
-if_iwi_load="NO"		# Intel PRO/Wireless 2200BG/2225BG/2915ABG wireless
+if_iwi_load="NO"		# Intel PRO/Wireless 2200BG/2225BG/2915ABG
+				# wireless
 if_ixgb_load="NO"		# Intel PRO/10Gb Ethernet
 if_le_load="NO"			# AMD Am7900 LANCE and Am79C9xx PCnet
-if_lge_load="NO"		# Level 1 LXT1001 NetCellerator PCI Gigabit Ethernet
+if_lge_load="NO"		# Level 1 LXT1001 NetCellerator PCI Gigabit
+				# Ethernet
 if_msk_load="NO"		# Marvell/SysKonnect Yukon II Gigabit Ethernet
 if_mxge_load="NO"		# Myricom Myri10GE 10Gb Ethernet
 if_my_load="NO"			# Myson PCI Fast Ethernet
@@ -289,18 +294,21 @@
 ng_ksocket_load="NO"		# kernel socket netgraph node type
 ng_l2tp_load="NO"		# L2TP protocol netgraph node type
 ng_lmi_load="NO"		# frame relay LMI protocol netgraph node type
-ng_mppc_load="NO"		# Microsoft MPPC/MPPE compression and encryption netgraph node type
-ng_netflow_load="NO"		# Cisco's NetFlow netgraph note type
+ng_mppc_load="NO"		# Microsoft MPPC/MPPE compression and
+				# encryption netgraph node type
+ng_netflow_load="NO"		# Cisco's NetFlow netgraph node type
 ng_one2many_load="NO"		# packet multiplexing netgraph node type
 ng_ppp_load="NO"		# PPP protocol netgraph node type
 ng_pppoe_load="NO"		# RFC 2516 PPPOE protocol netgraph node type
 ng_pptpgre_load="NO"		# PPTP GRE protocol netgraph node type
 ng_rfc1490_load="NO"		# RFC 1490 netgraph node type
 ng_socket_load="NO"		# Netgraph socket node type
-ng_split_load="NO"		# netgraph node to separate incoming and outgoing flows
+ng_split_load="NO"		# netgraph node to separate incoming and
+				# outgoing flows
 ng_sppp_load="NO"		# sppp netgraph node type
 ng_tee_load="NO"		# Netgraph ``tee'' node type
-ng_tty_load="NO"		# Netgraph node type that is also a line discipline
+ng_tty_load="NO"		# Netgraph node type that is also a line
+				# discipline
 ng_vjc_load="NO"		# Van Jacobsen compression netgraph node type
 ng_vlan_load="NO"		# IEEE 802.1Q VLAN tagging netgraph node type
 

==== //depot/projects/soc2006/intr_filter/compat/linux/linux_ipc.c#6 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ipc.c,v 1.53 2006/12/20 20:08:45 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ipc.c,v 1.54 2007/01/14 16:34:43 netchild Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -571,9 +571,13 @@
 		td->td_retval[0] = seminfo.semmni;
 		return 0;			/* No need for __semctl call */
 	case LINUX_GETALL:
-		/* FALLTHROUGH */
+		cmd = GETALL;
+		semun.val = args->arg.val;
+		break;
 	case LINUX_SETALL:
-		/* FALLTHROUGH */
+		cmd = SETALL;
+		semun.val = args->arg.val;
+		break;
 	default:
 		linux_msg(td, "ipc type %d is not implemented",
 		  args->cmd & ~LINUX_IPC_64);

==== //depot/projects/soc2006/intr_filter/compat/linux/linux_mib.c#4 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_mib.c,v 1.28 2007/01/07 19:20:17 netchild Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_mib.c,v 1.29 2007/01/14 16:07:01 netchild Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -233,7 +233,7 @@
 {
 	struct prison *pr;
 	struct linux_prison *lpr;
-	int use26 = 0;		/* defaults to off */
+	int use26 = linux_use_linux26;
 
 	pr = td->td_ucred->cr_prison;
 	if (pr != NULL) {
@@ -241,8 +241,7 @@
 			lpr = (struct linux_prison *)pr->pr_linux;
 			use26 = lpr->pr_use_linux26;
 		}
-	} else
-		use26 = linux_use_linux26;
+	}
 	
 	return (use26);
 }

==== //depot/projects/soc2006/intr_filter/dev/ath/ath_rate/sample/sample.c#3 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/ath_rate/sample/sample.c,v 1.15 2006/12/13 19:34:35 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/ath_rate/sample/sample.c,v 1.16 2007/01/15 01:17:44 sam Exp $");
 
 /*
  * John Bicket's SampleRate control algorithm.
@@ -533,24 +533,6 @@
 		    short_tries, long_tries);
 		return;
 	}
-
-	if (ts->ts_status) {		/* this packet failed */
-		DPRINTF(sc, ATH_DEBUG_RATE,
-"%s: %s size %d rate/try [%d/%d %d/%d %d/%d %d/%d] FAIL tries [%d/%d]\n", 
-		    __func__,
-		    ether_sprintf(an->an_node.ni_macaddr),
-		    bin_to_size(size_to_bin(frame_size)),
-		    sc->sc_hwmap[MS(ds0->ds_ctl3, AR_XmitRate0)].ieeerate,
-			MS(ds0->ds_ctl2, AR_XmitDataTries0),
-		    sc->sc_hwmap[MS(ds0->ds_ctl3, AR_XmitRate1)].ieeerate,
-			MS(ds0->ds_ctl2, AR_XmitDataTries1),
-		    sc->sc_hwmap[MS(ds0->ds_ctl3, AR_XmitRate2)].ieeerate,
-			MS(ds0->ds_ctl2, AR_XmitDataTries2),
-		    sc->sc_hwmap[MS(ds0->ds_ctl3, AR_XmitRate3)].ieeerate,
-			MS(ds0->ds_ctl2, AR_XmitDataTries3),
-		    short_tries, long_tries);
-	}
-
 	mrr = sc->sc_mrretry && !(ic->ic_flags & IEEE80211_F_USEPROT);
 	if (!mrr || !(ts->ts_rate & HAL_TXSTAT_ALTRATE)) {
 		int ndx = rate_to_ndx(sn, final_rate);
@@ -571,32 +553,43 @@
 			     0, 0,
 			     short_tries, long_tries, ts->ts_status);
 	} else {
-		int rate0, tries0, ndx0;
-		int rate1, tries1, ndx1;
-		int rate2, tries2, ndx2;
-		int rate3, tries3, ndx3;
+		int hwrate0, rate0, tries0, ndx0;
+		int hwrate1, rate1, tries1, ndx1;
+		int hwrate2, rate2, tries2, ndx2;
+		int hwrate3, rate3, tries3, ndx3;
 		int finalTSIdx = ts->ts_finaltsi;
 
 		/*
 		 * Process intermediate rates that failed.
 		 */
-		rate0 = sc->sc_hwmap[MS(ds0->ds_ctl3, AR_XmitRate0)].ieeerate;
+		if (sc->sc_ah->ah_magic != 0x20065416) {
+			hwrate0 = MS(ds0->ds_ctl3, AR_XmitRate0);
+			hwrate1 = MS(ds0->ds_ctl3, AR_XmitRate1);
+			hwrate2 = MS(ds0->ds_ctl3, AR_XmitRate2);
+			hwrate3 = MS(ds0->ds_ctl3, AR_XmitRate3);
+		} else {
+			hwrate0 = MS(ds0->ds_ctl3, AR5416_XmitRate0);
+			hwrate1 = MS(ds0->ds_ctl3, AR5416_XmitRate1);
+			hwrate2 = MS(ds0->ds_ctl3, AR5416_XmitRate2);
+			hwrate3 = MS(ds0->ds_ctl3, AR5416_XmitRate3);
+		}
+
+		rate0 = sc->sc_hwmap[hwrate0].ieeerate;
 		tries0 = MS(ds0->ds_ctl2, AR_XmitDataTries0);
 		ndx0 = rate_to_ndx(sn, rate0);
 
-		rate1 = sc->sc_hwmap[MS(ds0->ds_ctl3, AR_XmitRate1)].ieeerate;
+		rate1 = sc->sc_hwmap[hwrate1].ieeerate;
 		tries1 = MS(ds0->ds_ctl2, AR_XmitDataTries1);
 		ndx1 = rate_to_ndx(sn, rate1);
 
-		rate2 = sc->sc_hwmap[MS(ds0->ds_ctl3, AR_XmitRate2)].ieeerate;
+		rate2 = sc->sc_hwmap[hwrate2].ieeerate;
 		tries2 = MS(ds0->ds_ctl2, AR_XmitDataTries2);
 		ndx2 = rate_to_ndx(sn, rate2);
 
-		rate3 = sc->sc_hwmap[MS(ds0->ds_ctl3, AR_XmitRate3)].ieeerate;
+		rate3 = sc->sc_hwmap[hwrate3].ieeerate;
 		tries3 = MS(ds0->ds_ctl2, AR_XmitDataTries3);
 		ndx3 = rate_to_ndx(sn, rate3);
 
-#if 1
 		DPRINTF(sc, ATH_DEBUG_RATE,
 "%s: %s size %d finaltsidx %d tries %d %s rate/try [%d/%d %d/%d %d/%d %d/%d]\n", 
 		     __func__, ether_sprintf(an->an_node.ni_macaddr),
@@ -608,7 +601,6 @@
 		     rate1, tries1,
 		     rate2, tries2,
 		     rate3, tries3);
-#endif
 
 		/*
 		 * NB: series > 0 are not penalized for failure

==== //depot/projects/soc2006/intr_filter/dev/ath/ath_rate/sample/sample.h#4 (text+ko) ====

@@ -33,7 +33,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  *
- * $FreeBSD: src/sys/dev/ath/ath_rate/sample/sample.h,v 1.6 2006/12/13 19:34:35 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/ath_rate/sample/sample.h,v 1.7 2007/01/15 01:17:44 sam Exp $
  */
 
 /*
@@ -136,6 +136,16 @@
 #define	AR_XmitRate3		0x000f8000	/* series 3 tx rate */
 #define	AR_XmitRate3_S		15
 
+/* TX ds_ctl3 for 5416 */
+#define	AR5416_XmitRate0	0x000000ff	/* series 0 tx rate */
+#define	AR5416_XmitRate0_S	0
+#define	AR5416_XmitRate1	0x0000ff00	/* series 1 tx rate */
+#define	AR5416_XmitRate1_S	8
+#define	AR5416_XmitRate2	0x00ff0000	/* series 2 tx rate */
+#define	AR5416_XmitRate2_S	16
+#define	AR5416_XmitRate3	0xff000000	/* series 3 tx rate */
+#define	AR5416_XmitRate3_S	24
+
 #define MS(_v, _f)	(((_v) & (_f)) >> _f##_S)
 
 /*

==== //depot/projects/soc2006/intr_filter/dev/ath/if_ath.c#11 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.158 2006/12/27 19:07:09 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.159 2007/01/15 01:15:57 sam Exp $");
 
 /*
  * Driver for the Atheros Wireless LAN controller.
@@ -364,8 +364,8 @@
 	ath_rate_setup(sc, IEEE80211_MODE_11G);
 	ath_rate_setup(sc, IEEE80211_MODE_TURBO_A);
 	ath_rate_setup(sc, IEEE80211_MODE_TURBO_G);
-	ath_rate_setup(sc, IEEE80211_MODE_11A_HALF);
-	ath_rate_setup(sc, IEEE80211_MODE_11A_QUARTER);
+	ath_rate_setup(sc, IEEE80211_MODE_HALF);
+	ath_rate_setup(sc, IEEE80211_MODE_QUARTER);
 
 	/* NB: setup here so ath_rate_update is happy */
 	ath_setcurmode(sc, IEEE80211_MODE_11A);
@@ -885,8 +885,14 @@
 	}
 }
 
-static u_int
-ath_chan2flags(struct ieee80211com *ic, struct ieee80211_channel *chan)
+/*
+ * Convert net80211 channel to a HAL channel with the flags
+ * constrained to reflect the current operating mode and
+ * the frequency possibly mapped for GSM channels.
+ */
+static void
+ath_mapchan(struct ieee80211com *ic, HAL_CHANNEL *hc,
+	const struct ieee80211_channel *chan)
 {
 #define	N(a)	(sizeof(a) / sizeof(a[0]))
 	static const u_int modeflags[] = {
@@ -902,11 +908,14 @@
 
 	KASSERT(mode < N(modeflags), ("unexpected phy mode %u", mode));
 	KASSERT(modeflags[mode] != 0, ("mode %u undefined", mode));
+	hc->channelFlags = modeflags[mode];
 	if (IEEE80211_IS_CHAN_HALF(chan))
-		return modeflags[mode] | CHANNEL_HALF;
+		hc->channelFlags |= CHANNEL_HALF;
 	if (IEEE80211_IS_CHAN_QUARTER(chan))
-		return modeflags[mode] | CHANNEL_QUARTER;
-	return modeflags[mode];
+		hc->channelFlags |= CHANNEL_QUARTER;
+
+	hc->channel = IEEE80211_IS_CHAN_GSM(chan) ?
+		2422 + (922 - chan->ic_freq) : chan->ic_freq;
 #undef N
 }
 
@@ -936,8 +945,7 @@
 	 * be followed by initialization of the appropriate bits
 	 * and then setup of the interrupt mask.
 	 */
-	sc->sc_curchan.channel = ic->ic_curchan->ic_freq;
-	sc->sc_curchan.channelFlags = ath_chan2flags(ic, ic->ic_curchan);
+	ath_mapchan(ic, &sc->sc_curchan, ic->ic_curchan);
 	if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_FALSE, &status)) {
 		if_printf(ifp, "unable to reset hardware; hal status %u\n",
 			status);
@@ -1095,16 +1103,13 @@
 	struct ath_softc *sc = ifp->if_softc;
 	struct ieee80211com *ic = &sc->sc_ic;
 	struct ath_hal *ah = sc->sc_ah;
-	struct ieee80211_channel *c;
 	HAL_STATUS status;
 
 	/*
 	 * Convert to a HAL channel description with the flags
 	 * constrained to reflect the current operating mode.
 	 */
-	c = ic->ic_curchan;
-	sc->sc_curchan.channel = c->ic_freq;
-	sc->sc_curchan.channelFlags = ath_chan2flags(ic, c);
+	ath_mapchan(ic, &sc->sc_curchan, ic->ic_curchan);
 
 	ath_hal_intrset(ah, 0);		/* disable interrupts */
 	ath_draintxq(sc);		/* stop xmit side */
@@ -1122,7 +1127,7 @@
 	 * that changes the channel so update any state that
 	 * might change as a result.
 	 */
-	ath_chan_change(sc, c);
+	ath_chan_change(sc, ic->ic_curchan);
 	if (ath_startrecv(sc) != 0)	/* restart recv */
 		if_printf(ifp, "%s: unable to start recv logic\n", __func__);
 	if (ic->ic_state == IEEE80211_S_RUN)
@@ -1859,17 +1864,19 @@
 	struct ath_hal *ah = sc->sc_ah;
 	u_int usec;
 
-	if (IEEE80211_IS_CHAN_A(ic->ic_curchan)) {
-		if (IEEE80211_IS_CHAN_HALF(ic->ic_curchan))
-			usec = 13;
-		else if (IEEE80211_IS_CHAN_QUARTER(ic->ic_curchan))
-			usec = 21;
+	if (IEEE80211_IS_CHAN_HALF(ic->ic_curchan))
+		usec = 13;
+	else if (IEEE80211_IS_CHAN_QUARTER(ic->ic_curchan))
+		usec = 21;
+	else if (IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) {
+		/* honor short/long slot time only in 11g */
+		/* XXX shouldn't honor on pure g or turbo g channel */
+		if (ic->ic_flags & IEEE80211_F_SHSLOT)
+			usec = HAL_SLOT_TIME_9;
 		else
-			usec = HAL_SLOT_TIME_9;
-	} else if (ic->ic_flags & IEEE80211_F_SHSLOT)
+			usec = HAL_SLOT_TIME_20;
+	} else
 		usec = HAL_SLOT_TIME_9;
-	else
-		usec = HAL_SLOT_TIME_20;
 
 	DPRINTF(sc, ATH_DEBUG_RESET,
 	    "%s: chan %u MHz flags 0x%x %s slot, %u usec\n",
@@ -4318,13 +4325,12 @@
 	 * Change channels and update the h/w rate map
 	 * if we're switching; e.g. 11a to 11b/g.
 	 */
-	mode = ieee80211_chan2mode(ic, chan);
-	if (mode == IEEE80211_MODE_11A) {
-		if (IEEE80211_IS_CHAN_HALF(chan))
-			mode = IEEE80211_MODE_11A_HALF;
-		else if (IEEE80211_IS_CHAN_QUARTER(chan))
-			mode = IEEE80211_MODE_11A_QUARTER;
-	}
+	if (IEEE80211_IS_CHAN_HALF(chan))
+		mode = IEEE80211_MODE_HALF;
+	else if (IEEE80211_IS_CHAN_QUARTER(chan))
+		mode = IEEE80211_MODE_QUARTER;
+	else
+		mode = ieee80211_chan2mode(ic, chan);
 	if (mode != sc->sc_curmode)
 		ath_setcurmode(sc, mode);
 	/*
@@ -4340,6 +4346,10 @@
 		flags = IEEE80211_CHAN_B;
 	if (IEEE80211_IS_CHAN_T(chan))
 		flags |= IEEE80211_CHAN_TURBO;
+	if (IEEE80211_IS_CHAN_HALF(chan))
+		flags |= IEEE80211_CHAN_HALF;
+	if (IEEE80211_IS_CHAN_QUARTER(chan))
+		flags |= IEEE80211_CHAN_QUARTER;
 	sc->sc_tx_th.wt_chan_freq = sc->sc_rx_th.wr_chan_freq =
 		htole16(chan->ic_freq);
 	sc->sc_tx_th.wt_chan_flags = sc->sc_rx_th.wr_chan_flags =
@@ -4400,8 +4410,7 @@
 	 * the flags constrained to reflect the current
 	 * operating mode.
 	 */
-	hchan.channel = chan->ic_freq;
-	hchan.channelFlags = ath_chan2flags(ic, chan);
+	ath_mapchan(ic, &hchan, chan);
 
 	DPRINTF(sc, ATH_DEBUG_RESET,
 	    "%s: %u (%u MHz, hal flags 0x%x) -> %u (%u MHz, hal flags 0x%x)\n",
@@ -4829,6 +4838,9 @@
 				    ix, c->channel, c->channelFlags);
 			continue;
 		}
+		if (bootverbose)
+			if_printf(ifp, "hal channel %u/%x -> %u\n",
+			    c->channel, c->channelFlags, ix);
 		/*
 		 * Calculate net80211 flags; most are compatible
 		 * but some need massaging.  Note the static turbo
@@ -4838,6 +4850,12 @@
 		flags = c->channelFlags & COMPAT;
 		if (c->channelFlags & CHANNEL_STURBO)
 			flags |= IEEE80211_CHAN_TURBO;
+		if (ath_hal_isgsmsku(ah)) {
+			/* remap to true frequencies */
+			c->channel = 922 + (2422 - c->channel);
+			flags |= IEEE80211_CHAN_GSM;
+			ix = ieee80211_mhz2ieee(c->channel, flags);
+		}
 		if (ic->ic_channels[ix].ic_freq == 0) {
 			ic->ic_channels[ix].ic_freq = c->channel;
 			ic->ic_channels[ix].ic_flags = flags;
@@ -4943,10 +4961,10 @@
 	case IEEE80211_MODE_11A:
 		rt = ath_hal_getratetable(ah, HAL_MODE_11A);
 		break;
-	case IEEE80211_MODE_11A_HALF:
+	case IEEE80211_MODE_HALF:
 		rt = ath_hal_getratetable(ah, HAL_MODE_11A_HALF_RATE);
 		break;
-	case IEEE80211_MODE_11A_QUARTER:
+	case IEEE80211_MODE_QUARTER:
 		rt = ath_hal_getratetable(ah, HAL_MODE_11A_QUARTER_RATE);
 		break;
 	case IEEE80211_MODE_11B:
@@ -4995,6 +5013,7 @@
 		{   4, 267,  66 },
 		{   2, 400, 100 },
 		{   0, 500, 130 },
+		/* XXX half/quarter rates */
 	};
 	const HAL_RATE_TABLE *rt;
 	int i, j;

==== //depot/projects/soc2006/intr_filter/dev/ath/if_athvar.h#9 (text+ko) ====

@@ -33,7 +33,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  *
- * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.56 2006/12/27 19:07:09 sam Exp $
+ * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.58 2007/01/15 04:26:19 sam Exp $
  */
 
 /*
@@ -208,8 +208,8 @@
 				sc_xchanmode: 1,/* extended channel mode */
 				sc_outdoor  : 1;/* outdoor operation */
 						/* rate tables */
-#define	IEEE80211_MODE_11A_HALF		(IEEE80211_MODE_MAX+0)
-#define	IEEE80211_MODE_11A_QUARTER	(IEEE80211_MODE_MAX+1)
+#define	IEEE80211_MODE_HALF	(IEEE80211_MODE_MAX+0)
+#define	IEEE80211_MODE_QUARTER	(IEEE80211_MODE_MAX+1)
 	const HAL_RATE_TABLE	*sc_rates[IEEE80211_MODE_MAX+2];
 	const HAL_RATE_TABLE	*sc_currates;	/* current rate table */
 	enum ieee80211_phymode	sc_curmode;	/* current phy mode */
@@ -559,6 +559,11 @@
 	(((ah)->ah_regdomain == 0 && (ah)->ah_countryCode == 842) || \
 	 (ah)->ah_regdomain == 0x12)
 #endif
+#if HAL_ABI_VERSION < 0x06122400
+/* XXX yech, can't get to regdomain so just hack a compat shim */
+#define	ath_hal_isgsmsku(ah) \
+	((ah)->ah_countryCode == 843)
+#endif
 
 #define	ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \
 	((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq)))

==== //depot/projects/soc2006/intr_filter/dev/bce/if_bce.c#10 (text) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.24 2007/01/11 03:18:31 delphij Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.25 2007/01/13 04:35:15 jhb Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -305,6 +305,7 @@
 static int  bce_ioctl				(struct ifnet *, u_long, caddr_t);
 static void bce_watchdog			(struct bce_softc *);
 static int  bce_ifmedia_upd			(struct ifnet *);
+static void bce_ifmedia_upd_locked		(struct ifnet *);
 static void bce_ifmedia_sts			(struct ifnet *, struct ifmediareq *);
 static void bce_init_locked			(struct bce_softc *);
 static void bce_init				(void *);
@@ -3812,12 +3813,24 @@
 bce_ifmedia_upd(struct ifnet *ifp)
 {
 	struct bce_softc *sc;
+
+	sc = ifp->if_softc;
+	BCE_LOCK(sc);
+	bce_ifmedia_upd_locked(ifp);
+	BCE_UNLOCK(sc);
+	return (0);
+}
+
+static void
+bce_ifmedia_upd_locked(struct ifnet *ifp)
+{
+	struct bce_softc *sc;
 	struct mii_data *mii;
 	struct ifmedia *ifm;
-	int rc = 0;
 
 	sc = ifp->if_softc;
 	ifm = &sc->bce_ifmedia;
+	BCE_LOCK_ASSERT(sc);
 
 	/* DRC - ToDo: Add SerDes support. */
 
@@ -3825,13 +3838,11 @@
 	sc->bce_link = 0;
 	if (mii->mii_instance) {
 		struct mii_softc *miisc;
-		for (miisc = LIST_FIRST(&mii->mii_phys); miisc != NULL;
-		    miisc = LIST_NEXT(miisc, mii_list))
+
+		LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
 			mii_phy_reset(miisc);
 	}
 	mii_mediachg(mii);
-
-	return(rc);
 }
 
 
@@ -4444,7 +4455,7 @@
 	/* Enable host interrupts. */
 	bce_enable_intr(sc);
 
-	bce_ifmedia_upd(ifp);
+	bce_ifmedia_upd_locked(ifp);
 
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
@@ -4487,7 +4498,7 @@
 	REG_RD(sc, BCE_MISC_ENABLE_SET_BITS);
 	DELAY(20);
 
-	bce_ifmedia_upd(ifp);
+	bce_ifmedia_upd_locked(ifp);
 bce_mgmt_init_locked_exit:
 	DBPRINT(sc, BCE_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__);
 

==== //depot/projects/soc2006/intr_filter/dev/cy/cy_isa.c#5 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cy/cy_isa.c,v 1.146 2004/05/30 20:08:29 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cy/cy_isa.c,v 1.147 2007/01/13 11:00:56 bde Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,7 +74,7 @@
 {
 	struct resource *mem_res;
 	cy_addr iobase;
-	int mem_rid;
+	int error, mem_rid;
 
 	if (isa_get_logicalid(dev) != 0)	/* skip PnP probes */
 		return (ENXIO);
@@ -96,8 +96,9 @@
 	cy_outb(iobase, CY_CLEAR_INTR, 0, 0);
 	DELAY(500);
 
+	error = (cy_units(iobase, 0) == 0 ? ENXIO : 0);
 	bus_release_resource(dev, SYS_RES_MEMORY, mem_rid, mem_res);
-	return (cy_units(iobase, 0) == 0 ? ENXIO : 0);
+	return (error);
 }
 
 static int

==== //depot/projects/soc2006/intr_filter/dev/fb/creatorreg.h#2 (text+ko) ====

@@ -45,7 +45,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/fb/creatorreg.h,v 1.5 2005/07/10 11:16:34 marius Exp $
+ * $FreeBSD: src/sys/dev/fb/creatorreg.h,v 1.6 2007/01/13 22:33:11 marius Exp $
  */
 
 #ifndef _DEV_FB_CREATOR_H_

==== //depot/projects/soc2006/intr_filter/dev/fb/gallant12x22.c#2 (text+ko) ====

@@ -35,7 +35,7 @@
  *
  * Derived from: @(#)gallant19.h	8.1 (Berkeley) 6/11/93
  *
- * $FreeBSD: src/sys/dev/fb/gallant12x22.c,v 1.3 2005/01/06 01:42:40 imp Exp $
+ * $FreeBSD: src/sys/dev/fb/gallant12x22.c,v 1.4 2007/01/13 22:36:22 marius Exp $
  */
 
 static u_char gallant12x22_data[] = {

==== //depot/projects/soc2006/intr_filter/dev/mii/acphy.c#4 (text+ko) ====

@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/acphy.c,v 1.20 2006/12/02 21:19:54 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/acphy.c,v 1.21 2007/01/12 22:59:38 marius Exp $");
 
 /*
  * Driver for Altima AC101 10/100 PHY
@@ -156,6 +156,19 @@
 	sc->mii_capabilities =
 	    PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
 	device_printf(dev, " ");
+
+#define	ADD(m, c)	ifmedia_add(&mii->mii_media, (m), (c), NULL)
+	if ((PHY_READ(sc, MII_ACPHY_MCTL) & AC_MCTL_FX_SEL) != 0) {
+		sc->mii_flags |= MIIF_HAVEFIBER;
+		ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, 0, sc->mii_inst),
+		    MII_MEDIA_100_TX);
+		printf("100baseFX, ");
+		ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_FX, IFM_FDX, sc->mii_inst),
+		    MII_MEDIA_100_TX_FDX);
+		printf("100baseFX-FDX, ");
+	}
+#undef ADD
+
 	mii_phy_add_media(sc);
 	printf("\n");
 

==== //depot/projects/soc2006/intr_filter/dev/mii/acphyreg.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/mii/acphyreg.h,v 1.1 2001/02/07 19:57:16 semenu Exp $
+ * $FreeBSD: src/sys/dev/mii/acphyreg.h,v 1.2 2007/01/12 22:58:04 marius Exp $
  */
 
 #ifndef _DEV_MII_ACPHYREG_H_
@@ -57,20 +57,20 @@
 
 #define	MII_ACPHY_MCTL		0x15	/* Mode control */
 #define	AC_MCTL_FX_SEL		0x0001	/* FX mode */
-#define	AC_MCTL_BYP_PCS		0x0001	/* Bypass PCS */
-#define AC_MCTL_SCRMBL		0x0004	/* Data scrambling */	
-#define AC_MCTL_REM_LOOP	0x0008	/* Remote loopback */	
-#define AC_MCTL_DIS_WDT		0x0010	/* Disable watchdog timer */	
-#define AC_MCTL_DIS_REC		0x0020	/* Disable recv error counter */	
-#define AC_MCTL_REC_FULL	0x0040	/* Recv error counter full */	
-#define AC_MCTL_FRC_FEF		0x0080	/* Force Far End Fault Insert. */	
-#define AC_MCTL_DIS_FEF		0x0100	/* Disable FEF Insertion */	
-#define AC_MCTL_LED_SEL		0x0200	/* Compat LED config */	
-#define AC_MCTL_ALED_SEL	0x0400	/* ActLED RX&TX - RX only */	
-#define AC_MCTL_10BT_SEL	0x0800	/* Enable 7-wire interface */	
-#define AC_MCTL_DIS_JAB		0x1000	/* Disable jabber */	
-#define AC_MCTL_FRC_LINK	0x2000	/* Force TX link up */	
-#define AC_MCTL_DIS_NLP		0x4000	/* Disable NLP check */	
+#define	AC_MCTL_BYP_PCS		0x0002	/* Bypass PCS */
+#define	AC_MCTL_SCRMBL		0x0004	/* Data scrambling */
+#define	AC_MCTL_REM_LOOP	0x0008	/* Remote loopback */
+#define	AC_MCTL_DIS_WDT		0x0010	/* Disable watchdog timer */
+#define	AC_MCTL_DIS_REC		0x0020	/* Disable recv error counter */
+#define	AC_MCTL_REC_FULL	0x0040	/* Recv error counter full */
+#define	AC_MCTL_FRC_FEF		0x0080	/* Force Far End Fault Insert. */
+#define	AC_MCTL_DIS_FEF		0x0100	/* Disable FEF Insertion */
+#define	AC_MCTL_LED_SEL		0x0200	/* Compat LED config */
+#define	AC_MCTL_ALED_SEL	0x0400	/* ActLED RX&TX - RX only */
+#define	AC_MCTL_10BT_SEL	0x0800	/* Enable 7-wire interface */
+#define	AC_MCTL_DIS_JAB		0x1000	/* Disable jabber */
+#define	AC_MCTL_FRC_LINK	0x2000	/* Force TX link up */
+#define	AC_MCTL_DIS_NLP		0x4000	/* Disable NLP check */
 
 #define	MII_ACPHY_REC		0x18	/* Recv error counter */
 

==== //depot/projects/soc2006/intr_filter/dev/mii/amphy.c#4 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/amphy.c,v 1.21 2006/12/02 21:21:16 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/amphy.c,v 1.22 2007/01/12 22:27:46 marius Exp $");
 
 /*
  * driver for AMD AM79c873 PHYs
@@ -120,7 +120,7 @@
 
 #if 0
 	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst),
-	    BMCR_LOOP|BMCR_S100);
+	    MII_MEDIA_100_TX);
 #endif
 
 	mii_phy_reset(sc);

==== //depot/projects/soc2006/intr_filter/dev/mii/exphy.c#3 (text+ko) ====

@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/exphy.c,v 1.21 2006/07/03 02:53:39 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/exphy.c,v 1.23 2007/01/12 23:17:43 marius Exp $");
 
 /*
  * driver for 3Com internal PHYs
@@ -114,36 +114,27 @@
 static int	exphy_service(struct mii_softc *, struct mii_data *, int);
 static void	exphy_reset(struct mii_softc *);
 
+/*
+ * Some 3Com internal PHYs report zero for OUI and model, others use
+ * actual values.
+ * Note that the 3Com internal PHYs having OUI 0x105a and model 0 are
+ * handled fine by ukphy(4); they can be isolated and don't require
+ * special treatment after reset.
+ */
+static const struct mii_phydesc exphys[] = {
+	{ 0, 0, "3Com internal media interface" },
+	MII_PHY_DESC(BROADCOM, 3C905C),
+	MII_PHY_END
+};
+	
 static int
 exphy_probe(device_t dev)
 {
-	struct mii_attach_args *ma;
-	device_t		parent;
 
-	ma = device_get_ivars(dev);
-	parent = device_get_parent(device_get_parent(dev));
-
-	/*
-	 * Argh, 3Com PHY reports oui == 0 model == 0!
-	 */
-	if ((MII_OUI(ma->mii_id1, ma->mii_id2) != 0 ||
-	    MII_MODEL(ma->mii_id2) != 0) &&
-	    (MII_OUI(ma->mii_id1, ma->mii_id2) != MII_OUI_BROADCOM ||
-	    MII_MODEL(ma->mii_id2) != MII_MODEL_BROADCOM_3C905C))
-		return (ENXIO);
-
-	/*
-	 * Make sure the parent is an `ex'.
-	 */
-	if (strcmp(device_get_name(parent), "xl") != 0)
-		return (ENXIO);
-
-	if (MII_OUI(ma->mii_id1, ma->mii_id2) == 0)
-		device_set_desc(dev, "3Com internal media interface");
-	else
-		device_set_desc(dev, MII_STR_BROADCOM_3C905C);
-
-	return (BUS_PROBE_DEFAULT);
+	if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))),
+	    "xl") == 0)
+		return (mii_phy_dev_probe(dev, exphys, BUS_PROBE_DEFAULT));
+	return (ENXIO);
 }
 
 static int
@@ -164,7 +155,7 @@
 	 */
 	if (mii->mii_instance != 0) {
 		device_printf(dev, "ignoring this PHY, non-zero instance\n");
-		return(ENXIO);
+		return (ENXIO);
 	}
 
 	LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
@@ -179,13 +170,8 @@
 
 #define	ADD(m, c)	ifmedia_add(&mii->mii_media, (m), (c), NULL)
 
-#if 0 /* See above. */
-	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst),
-	    BMCR_ISO);
-#endif
-
 	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst),
-	    BMCR_LOOP|BMCR_S100);
+	    MII_MEDIA_100_TX);
 
 	exphy_reset(sc);
 
@@ -196,7 +182,7 @@
 	printf("\n");
 #undef ADD
 	MIIBUS_MEDIAINIT(sc->mii_dev);
-	return(0);
+	return (0);
 }
 
 static int
@@ -232,12 +218,6 @@
 			return (0);
 
 		/*
-		 * Only used for autonegotiation.
-		 */
-		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
-			break;
-
-		/*
 		 * The 3Com PHY's autonegotiation doesn't need to be
 		 * kicked; it continues in the background.
 		 */

==== //depot/projects/soc2006/intr_filter/dev/mii/inphy.c#4 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/inphy.c,v 1.16 2006/12/02 15:32:33 marius Exp $");

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701151027.l0FARRTY058071>