PERFORCE change 112967 for review
Jung-uk Kim
jkim at FreeBSD.org
Tue Jan 16 01:14:26 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=112967
Change 112967 by jkim at jkim_hammer on 2007/01/16 01:13:58
IFC
Affected files ...
.. //depot/projects/linuxolator/src/sys/dev/aac/aac_cam.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/acpica/acpi_cpu.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/ath/ath_rate/sample/sample.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/ath/ath_rate/sample/sample.h#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/ath/if_ath.c#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/ath/if_athvar.h#6 integrate
.. //depot/projects/linuxolator/src/sys/dev/bge/if_bge.c#11 integrate
.. //depot/projects/linuxolator/src/sys/dev/bge/if_bgereg.h#9 integrate
.. //depot/projects/linuxolator/src/sys/dev/mii/brgphy.c#5 integrate
.. //depot/projects/linuxolator/src/sys/dev/mii/miidevs#5 integrate
.. //depot/projects/linuxolator/src/sys/fs/udf/udf_vnops.c#3 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_subr.c#4 edit
.. //depot/projects/linuxolator/src/sys/net80211/_ieee80211.h#3 integrate
.. //depot/projects/linuxolator/src/sys/net80211/ieee80211.c#5 integrate
.. //depot/projects/linuxolator/src/sys/net80211/ieee80211_node.c#4 integrate
.. //depot/projects/linuxolator/src/sys/netgraph/ng_deflate.c#3 integrate
.. //depot/projects/linuxolator/src/sys/netgraph/ng_pred1.c#2 integrate
.. //depot/projects/linuxolator/src/sys/netgraph/ng_tcpmss.c#2 integrate
.. //depot/projects/linuxolator/src/sys/netinet/if_ether.c#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_asconf.c#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_constants.h#4 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_crc32.c#2 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_indata.c#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_indata.h#2 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_input.c#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_os_bsd.h#4 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_output.c#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_pcb.c#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_pcb.h#4 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_structs.h#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_uio.h#4 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_usrreq.c#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctp_var.h#3 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctputil.c#5 integrate
.. //depot/projects/linuxolator/src/sys/netinet/sctputil.h#4 integrate
.. //depot/projects/linuxolator/src/sys/netinet6/sctp6_usrreq.c#5 integrate
.. //depot/projects/linuxolator/src/sys/powerpc/powerpc/cpu.c#2 integrate
.. //depot/projects/linuxolator/src/sys/powerpc/powerpc/machdep.c#4 integrate
.. //depot/projects/linuxolator/src/sys/sparc64/sbus/sbus.c#2 integrate
.. //depot/projects/linuxolator/src/sys/sys/systm.h#6 integrate
Differences ...
==== //depot/projects/linuxolator/src/sys/dev/aac/aac_cam.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.25 2006/11/02 00:54:33 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.26 2007/01/15 16:22:20 scottl Exp $");
/*
* CAM front-end for communicating with non-DASD devices
@@ -586,6 +586,7 @@
device_printf(sc->aac_dev,"Error %d sending ResetBus command\n",
e);
aac_release_sync_fib(sc);
+ mtx_unlock(&sc->aac_io_lock);
return (CAM_REQ_ABORTED);
}
==== //depot/projects/linuxolator/src/sys/dev/acpica/acpi_cpu.c#3 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.61 2007/01/08 00:45:46 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.62 2007/01/15 18:17:36 njl Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -480,7 +480,8 @@
* was an error parsing it. Switch back to generic mode.
*/
cpu_cx_generic = TRUE;
- device_printf(sc->cpu_dev, "Switching to generic Cx mode\n");
+ if (bootverbose)
+ device_printf(sc->cpu_dev, "switching to generic Cx mode\n");
}
/*
@@ -574,20 +575,18 @@
buf.Pointer = NULL;
buf.Length = ACPI_ALLOCATE_BUFFER;
status = AcpiEvaluateObject(sc->cpu_handle, "_CST", NULL, &buf);
- if (ACPI_FAILURE(status)) {
- device_printf(sc->cpu_dev, "Unable to find _CST method\n");
+ if (ACPI_FAILURE(status))
return (ENXIO);
- }
/* _CST is a package with a count and at least one Cx package. */
top = (ACPI_OBJECT *)buf.Pointer;
if (!ACPI_PKG_VALID(top, 2) || acpi_PkgInt32(top, 0, &count) != 0) {
- device_printf(sc->cpu_dev, "Invalid _CST package\n");
+ device_printf(sc->cpu_dev, "invalid _CST package\n");
AcpiOsFree(buf.Pointer);
return (ENXIO);
}
if (count != top->Package.Count - 1) {
- device_printf(sc->cpu_dev, "Invalid _CST state count (%d != %d)\n",
+ device_printf(sc->cpu_dev, "invalid _CST state count (%d != %d)\n",
count, top->Package.Count - 1);
count = top->Package.Count - 1;
}
==== //depot/projects/linuxolator/src/sys/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/linuxolator/src/sys/dev/ath/ath_rate/sample/sample.h#3 (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/linuxolator/src/sys/dev/ath/if_ath.c#6 (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/linuxolator/src/sys/dev/ath/if_athvar.h#6 (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/linuxolator/src/sys/dev/bge/if_bge.c#11 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.172 2006/12/26 18:33:55 bde Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.173 2007/01/15 21:43:43 jkim Exp $");
/*
* Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
@@ -1686,7 +1686,7 @@
br != NULL ? "" : "unknown ", id >> 16);
device_set_desc_copy(dev, buf);
if (pci_get_subvendor(dev) == DELL_VENDORID)
- sc->bge_flags |= BGE_FLAG_NO3LED;
+ sc->bge_flags |= BGE_FLAG_NO_3LED;
return (0);
}
t++;
@@ -2197,25 +2197,36 @@
case BGE_ASICREV_BCM5704:
sc->bge_flags |= BGE_FLAG_5700_FAMILY | BGE_FLAG_JUMBO;
break;
-
case BGE_ASICREV_BCM5714_A0:
case BGE_ASICREV_BCM5780:
case BGE_ASICREV_BCM5714:
sc->bge_flags |= BGE_FLAG_5714_FAMILY /* | BGE_FLAG_JUMBO */;
- /* Fall through */
-
+ /* FALLTHRU */
case BGE_ASICREV_BCM5750:
case BGE_ASICREV_BCM5752:
case BGE_ASICREV_BCM5755:
case BGE_ASICREV_BCM5787:
sc->bge_flags |= BGE_FLAG_575X_PLUS;
- /* Fall through */
-
+ /* FALLTHRU */
case BGE_ASICREV_BCM5705:
sc->bge_flags |= BGE_FLAG_5705_PLUS;
break;
}
+ /* Set various bug flags. */
+ if (sc->bge_chiprev == BGE_CHIPREV_5703_AX ||
+ sc->bge_chiprev == BGE_CHIPREV_5704_AX)
+ sc->bge_flags |= BGE_FLAG_ADC_BUG;
+ if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0)
+ sc->bge_flags |= BGE_FLAG_5704_A0_BUG;
+ if (BGE_IS_5705_PLUS(sc)) {
+ if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
+ sc->bge_asicrev == BGE_ASICREV_BCM5787)
+ sc->bge_flags |= BGE_FLAG_JITTER_BUG;
+ else
+ sc->bge_flags |= BGE_FLAG_BER_BUG;
+ }
+
/*
* Check if this is a PCI-X or PCI Express device.
*/
@@ -4190,7 +4201,7 @@
printf(" - PCI-X Bus\n");
if (sc->bge_flags & BGE_FLAG_PCIE)
printf(" - PCI Express Bus\n");
- if (sc->bge_flags & BGE_FLAG_NO3LED)
+ if (sc->bge_flags & BGE_FLAG_NO_3LED)
printf(" - No 3 LEDs\n");
if (sc->bge_flags & BGE_FLAG_RX_ALIGNBUG)
printf(" - RX Alignment Bug\n");
==== //depot/projects/linuxolator/src/sys/dev/bge/if_bgereg.h#9 (text+ko) ====
@@ -30,7 +30,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.66 2007/01/11 01:43:24 jdp Exp $
+ * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.67 2007/01/15 21:43:43 jkim Exp $
*/
/*
@@ -303,6 +303,9 @@
#define BGE_CHIPREV_5700_BX 0x71
#define BGE_CHIPREV_5700_CX 0x72
#define BGE_CHIPREV_5701_AX 0x00
+#define BGE_CHIPREV_5703_AX 0x10
+#define BGE_CHIPREV_5704_AX 0x20
+#define BGE_CHIPREV_5704_BX 0x21
#define BGE_CHIPREV_5750_AX 0x40
#define BGE_CHIPREV_5750_BX 0x41
@@ -2445,18 +2448,21 @@
struct resource *bge_res;
struct ifmedia bge_ifmedia; /* TBI media info */
uint32_t bge_flags;
-#define BGE_FLAG_EXTRAM 0x00000001 /* External SSRAM (unused) */
-#define BGE_FLAG_TBI 0x00000002
-#define BGE_FLAG_RX_ALIGNBUG 0x00000004
-#define BGE_FLAG_NO3LED 0x00000008
-#define BGE_FLAG_PCIX 0x00000010
-#define BGE_FLAG_PCIE 0x00000020
-#define BGE_FLAG_JUMBO 0x00000040
-#define BGE_FLAG_5700_FAMILY 0x00000100
-#define BGE_FLAG_5705_PLUS 0x00000200
-#define BGE_FLAG_5714_FAMILY 0x00000400
-#define BGE_FLAG_575X_PLUS 0x00000800
-#define BGE_FLAG_MSI 0x00001000
+#define BGE_FLAG_TBI 0x00000001
+#define BGE_FLAG_JUMBO 0x00000002
+#define BGE_FLAG_MSI 0x00000100
+#define BGE_FLAG_PCIX 0x00000200
+#define BGE_FLAG_PCIE 0x00000400
+#define BGE_FLAG_5700_FAMILY 0x00001000
+#define BGE_FLAG_5705_PLUS 0x00002000
+#define BGE_FLAG_5714_FAMILY 0x00004000
+#define BGE_FLAG_575X_PLUS 0x00008000
+#define BGE_FLAG_RX_ALIGNBUG 0x00100000
+#define BGE_FLAG_NO_3LED 0x00200000
+#define BGE_FLAG_ADC_BUG 0x00400000
+#define BGE_FLAG_5704_A0_BUG 0x00800000
+#define BGE_FLAG_JITTER_BUG 0x01000000
+#define BGE_FLAG_BER_BUG 0x02000000
uint32_t bge_chipid;
uint8_t bge_asicrev;
uint8_t bge_chiprev;
==== //depot/projects/linuxolator/src/sys/dev/mii/brgphy.c#5 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/brgphy.c,v 1.52 2006/12/20 00:34:12 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/brgphy.c,v 1.55 2007/01/16 00:52:26 jkim Exp $");
/*
* Driver for the Broadcom BCR5400 1000baseTX PHY.
@@ -66,6 +66,12 @@
static int brgphy_probe(device_t);
static int brgphy_attach(device_t);
+struct brgphy_softc {
+ struct mii_softc mii_sc;
+ int mii_model;
+ int mii_rev;
+};
+
static device_method_t brgphy_methods[] = {
/* device interface */
DEVMETHOD(device_probe, brgphy_probe),
@@ -93,9 +99,12 @@
static void brgphy_loop(struct mii_softc *);
static void bcm5401_load_dspcode(struct mii_softc *);
static void bcm5411_load_dspcode(struct mii_softc *);
-static void bcm5703_load_dspcode(struct mii_softc *);
-static void bcm5750_load_dspcode(struct mii_softc *);
-static int brgphy_mii_model;
+static void brgphy_fixup_adc_bug(struct mii_softc *);
+static void brgphy_fixup_5704_a0_bug(struct mii_softc *);
+static void brgphy_fixup_ber_bug(struct mii_softc *);
+static void brgphy_fixup_jitter_bug(struct mii_softc *);
+static void brgphy_ethernet_wirespeed(struct mii_softc *);
+static void brgphy_jumbo_settings(struct mii_softc *, u_long);
static const struct mii_phydesc brgphys[] = {
MII_PHY_DESC(xxBROADCOM, BCM5400),
@@ -112,6 +121,7 @@
MII_PHY_DESC(xxBROADCOM, BCM5752),
MII_PHY_DESC(xxBROADCOM, BCM5754),
MII_PHY_DESC(xxBROADCOM, BCM5780),
+ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787),
MII_PHY_END
};
@@ -125,6 +135,7 @@
static int
brgphy_attach(device_t dev)
{
+ struct brgphy_softc *bsc;
struct mii_softc *sc;
struct mii_attach_args *ma;
struct mii_data *mii;
@@ -133,7 +144,8 @@
struct bce_softc *bce_sc = NULL;
int fast_ether_only = FALSE;
- sc = device_get_softc(dev);
+ bsc = device_get_softc(dev);
+ sc = &bsc->mii_sc;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
@@ -157,7 +169,8 @@
BMCR_LOOP | BMCR_S100);
#endif
- brgphy_mii_model = MII_MODEL(ma->mii_id2);
+ bsc->mii_model = MII_MODEL(ma->mii_id2);
+ bsc->mii_rev = MII_REV(ma->mii_id2);
brgphy_reset(sc);
sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
@@ -204,6 +217,7 @@
static int
brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
{
+ struct brgphy_softc *bsc = (struct brgphy_softc *)sc;
struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
switch (cmd) {
@@ -301,10 +315,13 @@
if (sc->mii_media_active != mii->mii_media_active ||
sc->mii_media_status != mii->mii_media_status ||
cmd == MII_MEDIACHG) {
- switch (brgphy_mii_model) {
+ switch (bsc->mii_model) {
case MII_MODEL_xxBROADCOM_BCM5400:
+ bcm5401_load_dspcode(sc);
+ break;
case MII_MODEL_xxBROADCOM_BCM5401:
- bcm5401_load_dspcode(sc);
+ if (bsc->mii_rev == 1 || bsc->mii_rev == 3)
+ bcm5401_load_dspcode(sc);
break;
case MII_MODEL_xxBROADCOM_BCM5411:
bcm5411_load_dspcode(sc);
@@ -318,6 +335,7 @@
static void
brgphy_setmedia(struct mii_softc *sc, int media, int master)
{
+ struct brgphy_softc *bsc = (struct brgphy_softc *)sc;
int bmcr, gig;
switch (IFM_SUBTYPE(media)) {
@@ -351,7 +369,7 @@
PHY_WRITE(sc, BRGPHY_MII_BMCR,
bmcr | BRGPHY_BMCR_AUTOEN | BRGPHY_BMCR_STARTNEG);
- if (brgphy_mii_model != MII_MODEL_xxBROADCOM_BCM5701)
+ if (bsc->mii_model != MII_MODEL_xxBROADCOM_BCM5701)
return;
/*
@@ -432,12 +450,13 @@
static int
brgphy_mii_phy_auto(struct mii_softc *sc)
{
+ struct brgphy_softc *bsc = (struct brgphy_softc *)sc;
int ktcr = 0;
brgphy_loop(sc);
brgphy_reset(sc);
ktcr = BRGPHY_1000CTL_AFD | BRGPHY_1000CTL_AHD;
- if (brgphy_mii_model == MII_MODEL_xxBROADCOM_BCM5701)
+ if (bsc->mii_model == MII_MODEL_xxBROADCOM_BCM5701)
ktcr |= BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC;
PHY_WRITE(sc, BRGPHY_MII_1000CTL, ktcr);
ktcr = PHY_READ(sc, BRGPHY_MII_1000CTL);
@@ -515,7 +534,7 @@
}
static void
-bcm5703_load_dspcode(struct mii_softc *sc)
+brgphy_fixup_adc_bug(struct mii_softc *sc)
{
static const struct {
int reg;
@@ -533,7 +552,7 @@
}
static void
-bcm5704_load_dspcode(struct mii_softc *sc)
+brgphy_fixup_5704_a0_bug(struct mii_softc *sc)
{
static const struct {
int reg;
@@ -550,7 +569,7 @@
}
static void
-bcm5750_load_dspcode(struct mii_softc *sc)
+brgphy_fixup_ber_bug(struct mii_softc *sc)
{
static const struct {
int reg;
@@ -573,37 +592,83 @@
}
static void
+brgphy_fixup_jitter_bug(struct mii_softc *sc)
+{
+ static const struct {
+ int reg;
+ uint16_t val;
+ } dspcode[] = {
+ { BRGPHY_MII_AUXCTL, 0x0c00 },
+ { BRGPHY_MII_DSP_ADDR_REG, 0x000a },
+ { BRGPHY_MII_DSP_RW_PORT, 0x010b },
+ { BRGPHY_MII_AUXCTL, 0x0400 },
+ { 0, 0 },
+ };
+ int i;
+
+ for (i = 0; dspcode[i].reg != 0; i++)
+ PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val);
+}
+
+static void
+brgphy_ethernet_wirespeed(struct mii_softc *sc)
+{
+ u_int32_t val;
+
+ /* Enable Ethernet at WireSpeed. */
+ PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7007);
+ val = PHY_READ(sc, BRGPHY_MII_AUXCTL);
+ PHY_WRITE(sc, BRGPHY_MII_AUXCTL, val | (1 << 15) | (1 << 4));
+}
+
+static void
+brgphy_jumbo_settings(struct mii_softc *sc, u_long mtu)
+{
+ u_int32_t val;
+
+ /* Set or clear jumbo frame settings in the PHY. */
+ if (mtu > ETHER_MAX_LEN) {
+ PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7);
+ val = PHY_READ(sc, BRGPHY_MII_AUXCTL);
+ PHY_WRITE(sc, BRGPHY_MII_AUXCTL,
+ val | BRGPHY_AUXCTL_LONG_PKT);
+
+ val = PHY_READ(sc, BRGPHY_MII_PHY_EXTCTL);
+ PHY_WRITE(sc, BRGPHY_MII_PHY_EXTCTL,
+ val | BRGPHY_PHY_EXTCTL_HIGH_LA);
+ } else {
+ PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7);
+ val = PHY_READ(sc, BRGPHY_MII_AUXCTL);
+ PHY_WRITE(sc, BRGPHY_MII_AUXCTL,
+ val & ~(BRGPHY_AUXCTL_LONG_PKT | 0x7));
+
+ val = PHY_READ(sc, BRGPHY_MII_PHY_EXTCTL);
+ PHY_WRITE(sc, BRGPHY_MII_PHY_EXTCTL,
+ val & ~BRGPHY_PHY_EXTCTL_HIGH_LA);
+ }
+}
+
+static void
brgphy_reset(struct mii_softc *sc)
{
- u_int32_t val;
- struct ifnet *ifp;
- struct bge_softc *bge_sc = NULL;
- struct bce_softc *bce_sc = NULL;
+ struct brgphy_softc *bsc = (struct brgphy_softc *)sc;
+ struct bge_softc *bge_sc = NULL;
+ struct bce_softc *bce_sc = NULL;
+ struct ifnet *ifp;
mii_phy_reset(sc);
- switch (brgphy_mii_model) {
+ switch (bsc->mii_model) {
case MII_MODEL_xxBROADCOM_BCM5400:
+ bcm5401_load_dspcode(sc);
+ break;
case MII_MODEL_xxBROADCOM_BCM5401:
- bcm5401_load_dspcode(sc);
+ if (bsc->mii_rev == 1 || bsc->mii_rev == 3)
+ bcm5401_load_dspcode(sc);
break;
case MII_MODEL_xxBROADCOM_BCM5411:
bcm5411_load_dspcode(sc);
break;
- case MII_MODEL_xxBROADCOM_BCM5703:
- bcm5703_load_dspcode(sc);
- break;
- case MII_MODEL_xxBROADCOM_BCM5704:
- bcm5704_load_dspcode(sc);
- break;
- case MII_MODEL_xxBROADCOM_BCM5750:
- case MII_MODEL_xxBROADCOM_BCM5752:
- case MII_MODEL_xxBROADCOM_BCM5714:
- case MII_MODEL_xxBROADCOM_BCM5780:
- case MII_MODEL_xxBROADCOM_BCM5706C:
- case MII_MODEL_xxBROADCOM_BCM5708C:
- bcm5750_load_dspcode(sc);
- break;
}
ifp = sc->mii_pdata->mii_ifp;
@@ -617,53 +682,36 @@
/* Handle any NetXtreme/bge workarounds. */
if (bge_sc) {
+ /* Fix up various bugs */
+ if (bge_sc->bge_flags & BGE_FLAG_ADC_BUG)
+ brgphy_fixup_adc_bug(sc);
+ if (bge_sc->bge_flags & BGE_FLAG_5704_A0_BUG)
+ brgphy_fixup_5704_a0_bug(sc);
+ if (bge_sc->bge_flags & BGE_FLAG_BER_BUG)
+ brgphy_fixup_ber_bug(sc);
+ if (bge_sc->bge_flags & BGE_FLAG_JITTER_BUG)
+ brgphy_fixup_jitter_bug(sc);
+
+ brgphy_jumbo_settings(sc, ifp->if_mtu);
+
/*
* Don't enable Ethernet at WireSpeed for the 5700 or the
- * 5705 A1 and A2 chips. Make sure we only do this test
- * on "bge" NICs, since other drivers may use this same
- * PHY subdriver.
+ * 5705 A1 and A2 chips.
*/
- if (bge_sc->bge_asicrev == BGE_ASICREV_BCM5700 ||
- bge_sc->bge_chipid == BGE_CHIPID_BCM5705_A1 ||
- bge_sc->bge_chipid == BGE_CHIPID_BCM5705_A2)
- return;
+ if (bge_sc->bge_asicrev != BGE_ASICREV_BCM5700 &&
+ bge_sc->bge_chipid != BGE_CHIPID_BCM5705_A1 &&
+ bge_sc->bge_chipid != BGE_CHIPID_BCM5705_A2)
+ brgphy_ethernet_wirespeed(sc);
- /* Enable Ethernet at WireSpeed. */
- PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7007);
- val = PHY_READ(sc, BRGPHY_MII_AUXCTL);
- PHY_WRITE(sc, BRGPHY_MII_AUXCTL, val | (1 << 15) | (1 << 4));
-
/* Enable Link LED on Dell boxes */
- if (bge_sc->bge_flags & BGE_FLAG_NO3LED) {
+ if (bge_sc->bge_flags & BGE_FLAG_NO_3LED) {
PHY_WRITE(sc, BRGPHY_MII_PHY_EXTCTL,
PHY_READ(sc, BRGPHY_MII_PHY_EXTCTL) &
~BRGPHY_PHY_EXTCTL_3_LED);
}
} else if (bce_sc) {
- /* Set or clear jumbo frame settings in the PHY. */
- if (ifp->if_mtu > ETHER_MAX_LEN) {
- PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7);
- val = PHY_READ(sc, BRGPHY_MII_AUXCTL);
- PHY_WRITE(sc, BRGPHY_MII_AUXCTL,
- val | BRGPHY_AUXCTL_LONG_PKT);
-
- val = PHY_READ(sc, BRGPHY_MII_PHY_EXTCTL);
- PHY_WRITE(sc, BRGPHY_MII_PHY_EXTCTL,
- val | BRGPHY_PHY_EXTCTL_HIGH_LA);
- } else {
- PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7);
- val = PHY_READ(sc, BRGPHY_MII_AUXCTL);
- PHY_WRITE(sc, BRGPHY_MII_AUXCTL,
- val & ~(BRGPHY_AUXCTL_LONG_PKT | 0x7));
-
- val = PHY_READ(sc, BRGPHY_MII_PHY_EXTCTL);
- PHY_WRITE(sc, BRGPHY_MII_PHY_EXTCTL,
- val & ~BRGPHY_PHY_EXTCTL_HIGH_LA);
- }
-
- /* Enable Ethernet at Wirespeed */
- PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7007);
- val = PHY_READ(sc, BRGPHY_MII_AUXCTL);
- PHY_WRITE(sc, BRGPHY_MII_AUXCTL, (val | (1 << 15) | (1 << 4)));
+ brgphy_fixup_ber_bug(sc);
+ brgphy_jumbo_settings(sc, ifp->if_mtu);
+ brgphy_ethernet_wirespeed(sc);
}
}
==== //depot/projects/linuxolator/src/sys/dev/mii/miidevs#5 (text+ko) ====
@@ -1,4 +1,4 @@
-$FreeBSD: src/sys/dev/mii/miidevs,v 1.38 2007/01/05 01:46:26 ticso Exp $
+$FreeBSD: src/sys/dev/mii/miidevs,v 1.39 2007/01/15 21:43:43 jkim Exp $
/*$NetBSD: miidevs,v 1.6 1999/05/14 11:37:30 drochner Exp $*/
/*-
@@ -131,6 +131,7 @@
model xxBROADCOM BCM5780 0x0035 BCM5780 10/100/1000baseTX PHY
model xxBROADCOM BCM5706C 0x0015 BCM5706C 10/100/1000baseTX PHY
model xxBROADCOM BCM5708C 0x0036 BCM5708C 10/100/1000baseTX PHY
+model xxBROADCOM_ALT1 BCM5787 0x000e BCM5787 10/100/1000baseTX PHY
/* Cicada Semiconductor PHYs (now owned by Vitesse?) */
model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY
==== //depot/projects/linuxolator/src/sys/fs/udf/udf_vnops.c#3 (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/fs/udf/udf_vnops.c,v 1.62 2006/12/23 18:53:22 pav Exp $
+ * $FreeBSD: src/sys/fs/udf/udf_vnops.c,v 1.63 2007/01/15 18:45:36 pav Exp $
*/
/* udf_vnops.c */
@@ -339,38 +339,60 @@
}
}
+#define lblkno(udfmp, loc) ((loc) >> (udfmp)->bshift)
+#define blkoff(udfmp, loc) ((loc) & (udfmp)->bmask)
+#define lblktosize(imp, blk) ((blk) << (udfmp)->bshift)
+
static int
-udf_read(struct vop_read_args *a)
+udf_read(struct vop_read_args *ap)
{
- struct vnode *vp = a->a_vp;
- struct uio *uio = a->a_uio;
+ struct vnode *vp = ap->a_vp;
+ struct uio *uio = ap->a_uio;
struct udf_node *node = VTON(vp);
+ struct udf_mnt *udfmp;
struct buf *bp;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list