From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 00:11:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3B26106566C; Sun, 18 Oct 2009 00:11:49 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0B368FC08; Sun, 18 Oct 2009 00:11:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9I0BnMm054471; Sun, 18 Oct 2009 00:11:49 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9I0Bn0u054468; Sun, 18 Oct 2009 00:11:49 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200910180011.n9I0Bn0u054468@svn.freebsd.org> From: Weongyo Jeong Date: Sun, 18 Oct 2009 00:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198194 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 00:11:49 -0000 Author: weongyo Date: Sun Oct 18 00:11:49 2009 New Revision: 198194 URL: http://svn.freebsd.org/changeset/base/198194 Log: overhauls urtw(4) for supporting RTL8187B devices properly that there was major changes to initialize RF chipset and set H/W registers and removed a lot of magic numbers on code. Details are as follows: - uses the endpoint 0x89 to get TX status information which used to get TX complete or retry numbers or get a beacon interrupt. It's only valuable for RTL8187B. - removes urtw_write[8|16|32]_i functions that it's useless now. - uses ic->ic_updateslot to set SLOT, SIFS, DIES, EIFS, CW_VAL registers that doesn't set these whenever the channel is changed. - code for initializing RF chipset for RTL8187B changed a lot that there was many problems on TX transfers so it doesn't work properly even if just for a ping/pong. Now it becomes more stable than before that TX throughputs using netperf(1) were about 15 ~ 17Mbps/s though sometimes it encounters packet losses. - removes a lot of magic numbers that in the previous all of representing RX and TX descriptors were consisted of magic numbers and structures. It'd be more readable rather than before. - calculates TX duration more accurately for urtw(4) devices. - style(9) Modified: head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwreg.h head/sys/dev/usb/wlan/if_urtwvar.h Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sat Oct 17 23:04:04 2009 (r198193) +++ head/sys/dev/usb/wlan/if_urtw.c Sun Oct 18 00:11:49 2009 (r198194) @@ -76,6 +76,7 @@ enum { URTW_DEBUG_STATE = 0x00000020, /* 802.11 state transitions */ URTW_DEBUG_STAT = 0x00000040, /* statistic */ URTW_DEBUG_INIT = 0x00000080, /* initialization of dev */ + URTW_DEBUG_TXSTATUS = 0x00000100, /* tx status */ URTW_DEBUG_ANY = 0xffffffff }; #define DPRINTF(sc, m, fmt, ...) do { \ @@ -326,13 +327,47 @@ static struct urtw_pair urtw_8225v2_rf_p { 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 } }; -static struct urtw_pair urtw_8225v2b_rf_part1[] = { +static struct urtw_pair urtw_8225v2b_rf_part0[] = { { 0x00, 0x00b7 }, { 0x01, 0x0ee0 }, { 0x02, 0x044d }, { 0x03, 0x0441 }, { 0x04, 0x08c3 }, { 0x05, 0x0c72 }, { 0x06, 0x00e6 }, { 0x07, 0x082a }, { 0x08, 0x003f }, { 0x09, 0x0335 }, { 0x0a, 0x09d4 }, { 0x0b, 0x07bb }, { 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 } }; +static struct urtw_pair urtw_8225v2b_rf_part1[] = { + {0x0f0, 0x32}, {0x0f1, 0x32}, {0x0f2, 0x00}, + {0x0f3, 0x00}, {0x0f4, 0x32}, {0x0f5, 0x43}, + {0x0f6, 0x00}, {0x0f7, 0x00}, {0x0f8, 0x46}, + {0x0f9, 0xa4}, {0x0fa, 0x00}, {0x0fb, 0x00}, + {0x0fc, 0x96}, {0x0fd, 0xa4}, {0x0fe, 0x00}, + {0x0ff, 0x00}, {0x158, 0x4b}, {0x159, 0x00}, + {0x15a, 0x4b}, {0x15b, 0x00}, {0x160, 0x4b}, + {0x161, 0x09}, {0x162, 0x4b}, {0x163, 0x09}, + {0x1ce, 0x0f}, {0x1cf, 0x00}, {0x1e0, 0xff}, + {0x1e1, 0x0f}, {0x1e2, 0x00}, {0x1f0, 0x4e}, + {0x1f1, 0x01}, {0x1f2, 0x02}, {0x1f3, 0x03}, + {0x1f4, 0x04}, {0x1f5, 0x05}, {0x1f6, 0x06}, + {0x1f7, 0x07}, {0x1f8, 0x08}, {0x24e, 0x00}, + {0x20c, 0x04}, {0x221, 0x61}, {0x222, 0x68}, + {0x223, 0x6f}, {0x224, 0x76}, {0x225, 0x7d}, + {0x226, 0x84}, {0x227, 0x8d}, {0x24d, 0x08}, + {0x250, 0x05}, {0x251, 0xf5}, {0x252, 0x04}, + {0x253, 0xa0}, {0x254, 0x1f}, {0x255, 0x23}, + {0x256, 0x45}, {0x257, 0x67}, {0x258, 0x08}, + {0x259, 0x08}, {0x25a, 0x08}, {0x25b, 0x08}, + {0x260, 0x08}, {0x261, 0x08}, {0x262, 0x08}, + {0x263, 0x08}, {0x264, 0xcf}, {0x272, 0x56}, + {0x273, 0x9a}, {0x034, 0xf0}, {0x035, 0x0f}, + {0x05b, 0x40}, {0x084, 0x88}, {0x085, 0x24}, + {0x088, 0x54}, {0x08b, 0xb8}, {0x08c, 0x07}, + {0x08d, 0x00}, {0x094, 0x1b}, {0x095, 0x12}, + {0x096, 0x00}, {0x097, 0x06}, {0x09d, 0x1a}, + {0x09f, 0x10}, {0x0b4, 0x22}, {0x0be, 0x80}, + {0x0db, 0x00}, {0x0ee, 0x00}, {0x091, 0x03}, + {0x24c, 0x00}, {0x39f, 0x00}, {0x08c, 0x01}, + {0x08d, 0x10}, {0x08e, 0x08}, {0x08f, 0x00} +}; + static struct urtw_pair urtw_8225v2_rf_part2[] = { { 0x00, 0x01 }, { 0x01, 0x02 }, { 0x02, 0x42 }, { 0x03, 0x00 }, { 0x04, 0x00 }, { 0x05, 0x00 }, { 0x06, 0x40 }, { 0x07, 0x00 }, @@ -478,6 +513,7 @@ static const uint8_t urtw_8187b_reg_tabl static usb_callback_t urtw_bulk_rx_callback; static usb_callback_t urtw_bulk_tx_callback; +static usb_callback_t urtw_bulk_tx_status_callback; static const struct usb_config urtw_8187b_usbconfig[URTW_8187B_N_XFERS] = { [URTW_8187B_BULK_RX] = { @@ -492,6 +528,18 @@ static const struct usb_config urtw_8187 }, .callback = urtw_bulk_rx_callback }, + [URTW_8187B_BULK_TX_STATUS] = { + .type = UE_BULK, + .endpoint = 0x89, + .direction = UE_DIR_IN, + .bufsize = MCLBYTES, + .flags = { + .ext_buffer = 1, + .pipe_bof = 1, + .short_xfer_ok = 1 + }, + .callback = urtw_bulk_tx_status_callback + }, [URTW_8187B_BULK_TX_BE] = { .type = UE_BULK, .endpoint = URTW_8187B_TXPIPE_BE, @@ -703,9 +751,6 @@ static usb_error_t urtw_adapter_start(st static usb_error_t urtw_adapter_start_b(struct urtw_softc *); static usb_error_t urtw_set_mode(struct urtw_softc *, uint32_t); static usb_error_t urtw_8187b_cmd_reset(struct urtw_softc *); -static usb_error_t urtw_write16_i(struct urtw_softc *, int, uint16_t, int); -static usb_error_t urtw_write8_i(struct urtw_softc *, int, uint8_t, int); -static usb_error_t urtw_write32_i(struct urtw_softc *, int, uint32_t, int); static usb_error_t urtw_do_request(struct urtw_softc *, struct usb_device_request *, void *); static usb_error_t urtw_8225v2b_set_txpwrlvl(struct urtw_softc *, int); @@ -713,6 +758,10 @@ static usb_error_t urtw_led_off(struct u static void urtw_abort_xfers(struct urtw_softc *); static struct urtw_data * urtw_getbuf(struct urtw_softc *sc); +static int urtw_compute_txtime(uint16_t, uint16_t, uint8_t, + uint8_t); +static void urtw_updateslot(struct ifnet *); +static void urtw_updateslottask(void *, int); static int urtw_match(device_t dev) @@ -757,6 +806,7 @@ urtw_attach(device_t dev) MTX_DEF); usb_callout_init_mtx(&sc->sc_led_ch, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_led_task, 0, urtw_ledtask, sc); + TASK_INIT(&sc->sc_updateslot_task, 0, urtw_updateslottask, sc); callout_init(&sc->sc_watchdog_ch, 0); if (sc->sc_flags & URTW_RTL8187B) { @@ -845,7 +895,7 @@ urtw_attach(device_t dev) ic->ic_scan_start = urtw_scan_start; ic->ic_scan_end = urtw_scan_end; ic->ic_set_channel = urtw_set_channel; - + ic->ic_updateslot = urtw_updateslot; ic->ic_vap_create = urtw_vap_create; ic->ic_vap_delete = urtw_vap_delete; ic->ic_update_mcast = urtw_update_mcast; @@ -878,6 +928,7 @@ urtw_detach(device_t dev) return (0); urtw_stop(ifp, 1); + ieee80211_draintask(ic, &sc->sc_updateslot_task); ieee80211_draintask(ic, &sc->sc_led_task); usb_callout_drain(&sc->sc_led_ch); @@ -1014,6 +1065,9 @@ urtw_init_locked(void *arg) if (error != 0) goto fail; + if (sc->sc_flags & URTW_RTL8187B) + usbd_transfer_start(sc->sc_xfer[URTW_8187B_BULK_TX_STATUS]); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -1036,7 +1090,6 @@ static usb_error_t urtw_adapter_start_b(struct urtw_softc *sc) { #define N(a) (sizeof(a) / sizeof((a)[0])) - int i; uint8_t data8; usb_error_t error; @@ -1068,81 +1121,12 @@ urtw_adapter_start_b(struct urtw_softc * if (error) goto fail; - urtw_write16_m(sc, 0x2d, 0xfff); - urtw_read8_m(sc, URTW_CW_CONF, &data8); - urtw_write8_m(sc, URTW_CW_CONF, data8 | URTW_CW_CONF_PERPACKET_RETRY); - urtw_read8_m(sc, URTW_TX_AGC_CTL, &data8); - data8 |= URTW_TX_AGC_CTL_PERPACKET_GAIN | - URTW_TX_AGC_CTL_PERPACKET_ANTSEL; - urtw_write8_m(sc, URTW_TX_AGC_CTL, data8); - - error = urtw_write16_i(sc, 0xe0, 0xfff, 1); - if (error) - goto fail; - - urtw_read8_m(sc, URTW_RATE_FALLBACK, &data8); - urtw_write8_m(sc, URTW_RATE_FALLBACK, data8 | URTW_RATE_FALLBACK_ENABLE); - - urtw_write16_m(sc, URTW_ATIM_WND, 2); - urtw_write16_m(sc, URTW_BEACON_INTERVAL, 100); - error = urtw_write16_i(sc, 0xd4, 0xffff, 1); - if (error) - goto fail; - - error = urtw_set_mode(sc, URTW_EPROM_CMD_CONFIG); - if (error) - goto fail; - urtw_read8_m(sc, URTW_CONFIG1, &data8); - urtw_write8_m(sc, URTW_CONFIG1, (data8 & 0x3f) | 0x80); - error = urtw_set_mode(sc, URTW_EPROM_CMD_NORMAL); - if (error) - goto fail; - - urtw_write8_m(sc, URTW_WPA_CONFIG, 0); - for (i = 0; i < N(urtw_8187b_reg_table); i++) { - error = urtw_write8_i(sc, urtw_8187b_reg_table[i][0], - urtw_8187b_reg_table[i][1], urtw_8187b_reg_table[i][2]); - if (error) - goto fail; - } - - urtw_write16_m(sc, URTW_TID_AC_MAP, 0xfa50); - urtw_write16_m(sc, URTW_INT_MIG, 0); - - error = urtw_write32_i(sc, 0xf0, 0, 1); - if (error) - goto fail; - error = urtw_write32_i(sc, 0xf4, 0, 1); - if (error) - goto fail; - error = urtw_write8_i(sc, 0xf8, 0, 1); - if (error) - goto fail; - - urtw_write32_m(sc, URTW_RF_TIMING, 0x00004001); - - error = urtw_write16_i(sc, 0x72, 0x569a, 2); - if (error) - goto fail; - - error = urtw_set_mode(sc, URTW_EPROM_CMD_CONFIG); - if (error) - goto fail; - urtw_read8_m(sc, URTW_CONFIG3, &data8); - urtw_write8_m(sc, URTW_CONFIG3, data8 | URTW_CONFIG3_ANAPARAM_WRITE); - error = urtw_set_mode(sc, URTW_EPROM_CMD_NORMAL); - if (error) - goto fail; - - urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, 0x0480); - urtw_write16_m(sc, URTW_RF_PINS_SELECT, 0x2488); - urtw_write16_m(sc, URTW_RF_PINS_ENABLE, 0x1fff); - usb_pause_mtx(&sc->sc_mtx, 100); - error = sc->sc_rf_init(sc); if (error != 0) goto fail; + urtw_write8_m(sc, URTW_CMD, URTW_CMD_RX_ENABLE | URTW_CMD_TX_ENABLE); + /* fix RTL8187B RX stall */ error = urtw_intr_enable(sc); if (error) goto fail; @@ -1171,42 +1155,21 @@ urtw_adapter_start_b(struct urtw_softc * urtw_read8_m(sc, 0xdb, &data8); urtw_write8_m(sc, 0xdb, data8 | (1 << 2)); - error = urtw_write16_i(sc, 0x72, 0x59fa, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x74, 0x59d2, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x76, 0x59d2, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x78, 0x19fa, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x7a, 0x19fa, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x7c, 0x00d0, 3); - if (error) - goto fail; + urtw_write16_m(sc, 0x372, 0x59fa); + urtw_write16_m(sc, 0x374, 0x59d2); + urtw_write16_m(sc, 0x376, 0x59d2); + urtw_write16_m(sc, 0x378, 0x19fa); + urtw_write16_m(sc, 0x37a, 0x19fa); + urtw_write16_m(sc, 0x37c, 0x00d0); urtw_write8_m(sc, 0x61, 0); - error = urtw_write8_i(sc, 0x80, 0x0f, 1); - if (error) - goto fail; - error = urtw_write8_i(sc, 0x83, 0x03, 1); - if (error) - goto fail; - urtw_write8_m(sc, 0xda, 0x10); - error = urtw_write8_i(sc, 0x4d, 0x08, 2); - if (error) - goto fail; - - urtw_write32_m(sc, URTW_HSSI_PARA, 0x0600321B); - error = urtw_write16_i(sc, 0xec, 0x800, 1); - if (error) - goto fail; + urtw_write8_m(sc, 0x180, 0x0f); + urtw_write8_m(sc, 0x183, 0x03); + urtw_write8_m(sc, 0xda, 0x10); + urtw_write8_m(sc, 0x24d, 0x08); + urtw_write32_m(sc, URTW_HSSI_PARA, 0x0600321b); + urtw_write16_m(sc, 0x1ec, 0x800); /* RX MAX SIZE */ fail: return (error); #undef N @@ -1310,41 +1273,11 @@ urtw_8187b_cmd_reset(struct urtw_softc * device_printf(sc->sc_dev, "reset timeout\n"); goto fail; } - - error = urtw_set_mode(sc, URTW_EPROM_CMD_LOAD); - if (error) - goto fail; - - for (i = 0; i < 20; i++) { - usb_pause_mtx(&sc->sc_mtx, 4); - urtw_read8_m(sc, URTW_EPROM_CMD, &data8); - if (!(data8 & URTW_EPROM_CMD_CONFIG)) - break; - } - if (i >= 20) { - device_printf(sc->sc_dev, "eeprom reset timeout\n"); - goto fail; - } - fail: return (error); } static usb_error_t -urtw_write16_i(struct urtw_softc *sc, int val, uint16_t data, int idx) -{ - struct usb_device_request req; - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, idx & 0x3); - USETW(req.wLength, sizeof(uint16_t)); - - return (urtw_do_request(sc, &req, &data)); -} - -static usb_error_t urtw_do_request(struct urtw_softc *sc, struct usb_device_request *req, void *data) { @@ -1367,34 +1300,6 @@ urtw_do_request(struct urtw_softc *sc, return (err); } -static usb_error_t -urtw_write8_i(struct urtw_softc *sc, int val, uint8_t data, int idx) -{ - struct usb_device_request req; - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, idx & 0x3); - USETW(req.wLength, sizeof(uint8_t)); - - return (urtw_do_request(sc, &req, &data)); -} - -static usb_error_t -urtw_write32_i(struct urtw_softc *sc, int val, uint32_t data, int idx) -{ - struct usb_device_request req; - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, idx & 0x3); - USETW(req.wLength, sizeof(uint32_t)); - - return (urtw_do_request(sc, &req, &data)); -} - static void urtw_stop_locked(struct ifnet *ifp, int disable) { @@ -1534,6 +1439,7 @@ urtw_start(struct ifnet *ifp) } sc->sc_txtimer = 5; + callout_reset(&sc->sc_watchdog_ch, hz, urtw_watchdog, sc); } URTW_UNLOCK(sc); } @@ -1733,14 +1639,12 @@ static int urtw_tx_start(struct urtw_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, struct urtw_data *data, int prior) { - int xferlen; struct ifnet *ifp = sc->sc_ifp; struct ieee80211_frame *wh = mtod(m0, struct ieee80211_frame *); struct ieee80211_key *k; const struct ieee80211_txparam *tp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = ni->ni_vap; - struct urtw_8187b_txhdr *hdr; struct usb_xfer *rtl8187b_pipes[URTW_8187B_TXPIPE_MAX] = { sc->sc_xfer[URTW_8187B_BULK_TX_BE], sc->sc_xfer[URTW_8187B_BULK_TX_BK], @@ -1748,6 +1652,10 @@ urtw_tx_start(struct urtw_softc *sc, str sc->sc_xfer[URTW_8187B_BULK_TX_VO] }; struct usb_xfer *xfer; + int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate, + pkttime = 0, txdur = 0, isshort = 0, xferlen; + uint16_t acktime, rtstime, ctstime; + uint32_t flags; usb_error_t error; URTW_ASSERT_LOCKED(sc); @@ -1780,60 +1688,107 @@ urtw_tx_start(struct urtw_softc *sc, str ieee80211_radiotap_tx(vap, m0); } + if ((wh->i_fc[10] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT || + (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) { + tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; + rate = tp->mgmtrate; + } else { + tp = &vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)]; + /* for data frames */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + rate = tp->mcastrate; + else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) + rate = tp->ucastrate; + else + rate = urtw_rtl2rate(sc->sc_currate); + } + + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + txdur = pkttime = urtw_compute_txtime(m0->m_pkthdr.len + + IEEE80211_CRC_LEN, rate, 0, 0); + else { + acktime = urtw_compute_txtime(14, 2,0, 0); + if ((m0->m_pkthdr.len + 4) > vap->iv_rtsthreshold) { + rtsenable = 1; + ctsenable = 0; + rtstime = urtw_compute_txtime(URTW_ACKCTS_LEN, 2, 0, 0); + ctstime = urtw_compute_txtime(14, 2, 0, 0); + pkttime = urtw_compute_txtime(m0->m_pkthdr.len + + IEEE80211_CRC_LEN, rate, 0, isshort); + rtsdur = ctstime + pkttime + acktime + + 3 * URTW_ASIFS_TIME; + txdur = rtstime + rtsdur; + } else { + rtsenable = ctsenable = rtsdur = 0; + pkttime = urtw_compute_txtime(m0->m_pkthdr.len + + IEEE80211_CRC_LEN, rate, 0, isshort); + txdur = pkttime + URTW_ASIFS_TIME + acktime; + } + + if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) + dur = urtw_compute_txtime(m0->m_pkthdr.len + + IEEE80211_CRC_LEN, rate, 0, isshort) + + 3 * URTW_ASIFS_TIME + + 2 * acktime; + else + dur = URTW_ASIFS_TIME + acktime; + } + *(uint16_t *)wh->i_dur = htole16(dur); + xferlen = m0->m_pkthdr.len; xferlen += (sc->sc_flags & URTW_RTL8187B) ? (4 * 8) : (4 * 3); if ((0 == xferlen % 64) || (0 == xferlen % 512)) xferlen += 1; bzero(data->buf, URTW_TX_MAXSIZE); - data->buf[0] = m0->m_pkthdr.len & 0xff; - data->buf[1] = (m0->m_pkthdr.len & 0x0f00) >> 8; - data->buf[1] |= (1 << 7); - + flags = m0->m_pkthdr.len & 0xfff; + flags |= URTW_TX_FLAG_NO_ENC; if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) && (sc->sc_preamble_mode == URTW_PREAMBLE_MODE_SHORT) && (sc->sc_currate != 0)) - data->buf[2] |= 1; - if ((m0->m_pkthdr.len > vap->iv_rtsthreshold) && - prior == URTW_PRIORITY_LOW) { - device_printf(sc->sc_dev, "TODO tx.\n"); - return (EIO); - } + flags |= URTW_TX_FLAG_SPLCP; if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) - data->buf[2] |= (1 << 1); - /* RTS rate - 10 means we use a basic rate. */ - data->buf[2] |= (urtw_rate2rtl(2) << 3); - /* - * XXX currently TX rate control depends on the rate value of - * RX descriptor because I don't know how to we can control TX rate - * in more smart way. Please fix me you find a thing. - */ - data->buf[3] = sc->sc_currate; - if (prior == URTW_PRIORITY_NORMAL) { - tp = &vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)]; - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) - data->buf[3] = urtw_rate2rtl(tp->mcastrate); - else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) - data->buf[3] = urtw_rate2rtl(tp->ucastrate); - } + flags |= URTW_TX_FLAG_MOREFRAG; + + flags |= (sc->sc_currate & 0xf) << URTW_TX_FLAG_TXRATE_SHIFT; if (sc->sc_flags & URTW_RTL8187B) { - hdr = (struct urtw_8187b_txhdr *)data->buf; - hdr->rts_duration = 0; - hdr->len = 0; - hdr->retry = 3 | (7 << 4) | 11; - hdr->tx_duration = ieee80211_compute_duration(ic->ic_rt, - m0->m_pkthdr.len + IEEE80211_CRC_LEN, - urtw_rtl2rate(data->buf[3]), - (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0); - /* XXX MUST fill another variables like rts_duration, tx_.. */ - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[32]); + struct urtw_8187b_txhdr *tx; + + tx = (struct urtw_8187b_txhdr *)data->buf; + if (ctsenable) + flags |= URTW_TX_FLAG_CTS; + if (rtsenable) { + flags |= URTW_TX_FLAG_RTS; + flags |= (urtw_rate2rtl(11) & 0xf) << + URTW_TX_FLAG_RTSRATE_SHIFT; + tx->rtsdur = rtsdur; + } + tx->flag = htole32(flags); + tx->txdur = txdur; + if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == + IEEE80211_FC0_TYPE_MGT && + (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == + IEEE80211_FC0_SUBTYPE_PROBE_RESP) + tx->retry = 1; + else + tx->retry = URTW_TX_MAXRETRY; + m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(tx + 1)); } else { - data->buf[8] = 3; /* CW minimum */ - data->buf[8] |= (7 << 4); /* CW maximum */ - data->buf[9] |= 11; /* retry limitation */ - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[12]); + struct urtw_8187l_txhdr *tx; + + tx = (struct urtw_8187l_txhdr *)data->buf; + if (rtsenable) { + flags |= URTW_TX_FLAG_RTS; + tx->rtsdur = rtsdur; + } + flags |= (urtw_rate2rtl(11) & 0xf) << URTW_TX_FLAG_RTSRATE_SHIFT; + tx->flag = htole32(flags); + tx->retry = 3; /* CW minimum */ + tx->retry = 7 << 4; /* CW maximum */ + tx->retry = URTW_TX_MAXRETRY << 8; /* retry limitation */ + m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(tx + 1)); } data->buflen = xferlen; @@ -2054,8 +2009,8 @@ urtw_read8_c(struct urtw_softc *sc, int req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = URTW_8187_GETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint8_t)); error = urtw_do_request(sc, &req, data); @@ -2072,8 +2027,8 @@ urtw_read16_c(struct urtw_softc *sc, int req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = URTW_8187_GETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint16_t)); error = urtw_do_request(sc, &req, data); @@ -2090,8 +2045,8 @@ urtw_read32_c(struct urtw_softc *sc, int req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = URTW_8187_GETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint32_t)); error = urtw_do_request(sc, &req, data); @@ -2107,8 +2062,8 @@ urtw_write8_c(struct urtw_softc *sc, int req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint8_t)); return (urtw_do_request(sc, &req, &data)); @@ -2123,8 +2078,8 @@ urtw_write16_c(struct urtw_softc *sc, in req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint16_t)); return (urtw_do_request(sc, &req, &data)); @@ -2139,8 +2094,8 @@ urtw_write32_c(struct urtw_softc *sc, in req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint32_t)); return (urtw_do_request(sc, &req, &data)); @@ -2404,6 +2359,38 @@ urtw_get_rfchip(struct urtw_softc *sc) uint32_t data; usb_error_t error; + if (sc->sc_flags & URTW_RTL8187B) { + urtw_read8_m(sc, 0xe1, &data8); + switch (data8) { + case 0: + sc->sc_flags |= URTW_RTL8187B_REV_B; + break; + case 1: + sc->sc_flags |= URTW_RTL8187B_REV_D; + break; + case 2: + sc->sc_flags |= URTW_RTL8187B_REV_E; + break; + default: + device_printf(sc->sc_dev, "unknown type: %#x\n", data8); + sc->sc_flags |= URTW_RTL8187B_REV_B; + break; + } + } else { + urtw_read32_m(sc, URTW_TX_CONF, &data); + switch (data & URTW_TX_HWMASK) { + case URTW_TX_R8187vD_B: + sc->sc_flags |= URTW_RTL8187B; + break; + case URTW_TX_R8187vD: + break; + default: + device_printf(sc->sc_dev, "unknown RTL8187L type: %#x\n", + data & URTW_TX_HWMASK); + break; + } + } + error = urtw_eprom_read32(sc, URTW_EPROM_RFCHIPID, &data); if (error != 0) goto fail; @@ -2437,12 +2424,6 @@ urtw_get_rfchip(struct urtw_softc *sc) /* never reach */ } - if (sc->sc_flags & URTW_RTL8187B) { - urtw_read8_m(sc, 0xe1, &data8); - sc->sc_flags |= (data8 == 0) ? URTW_RTL8187B_REV_B : - (data8 == 1) ? URTW_RTL8187B_REV_D : URTW_RTL8187B_REV_E; - } - device_printf(sc->sc_dev, "%s rf %s hwrev %s\n", (sc->sc_flags & URTW_RTL8187B) ? "rtl8187b" : "rtl8187l", ((data & 0xff) == URTW_EPROM_RFCHIPID_RTL8225U) ? "rtl8225u" : @@ -2762,8 +2743,6 @@ fail0: return (error); static usb_error_t urtw_8225_rf_set_chan(struct urtw_softc *sc, int chan) { - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ieee80211_channel *c = ic->ic_curchan; usb_error_t error; error = urtw_8225_set_txpwrlvl(sc, chan); @@ -2771,27 +2750,6 @@ urtw_8225_rf_set_chan(struct urtw_softc goto fail; urtw_8225_write(sc, URTW_8225_ADDR_7_MAGIC, urtw_8225_channel[chan]); usb_pause_mtx(&sc->sc_mtx, 10); - - urtw_write8_m(sc, URTW_SIFS, 0x22); - - if (sc->sc_state == IEEE80211_S_ASSOC && - ic->ic_flags & IEEE80211_F_SHSLOT) - urtw_write8_m(sc, URTW_SLOT, 0x9); - else - urtw_write8_m(sc, URTW_SLOT, 0x14); - - if (IEEE80211_IS_CHAN_G(c)) { - /* for G */ - urtw_write8_m(sc, URTW_DIFS, 0x14); - urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x14); - urtw_write8_m(sc, URTW_CW_VAL, 0x73); - } else { - /* for B */ - urtw_write8_m(sc, URTW_DIFS, 0x24); - urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x24); - urtw_write8_m(sc, URTW_CW_VAL, 0xa5); - } - fail: return (error); } @@ -3039,8 +2997,6 @@ fail: static usb_error_t urtw_8225v2_rf_set_chan(struct urtw_softc *sc, int chan) { - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ieee80211_channel *c = ic->ic_curchan; usb_error_t error; error = urtw_8225v2_set_txpwrlvl(sc, chan); @@ -3049,27 +3005,6 @@ urtw_8225v2_rf_set_chan(struct urtw_soft urtw_8225_write(sc, URTW_8225_ADDR_7_MAGIC, urtw_8225_channel[chan]); usb_pause_mtx(&sc->sc_mtx, 10); - - urtw_write8_m(sc, URTW_SIFS, 0x22); - - if(sc->sc_state == IEEE80211_S_ASSOC && - ic->ic_flags & IEEE80211_F_SHSLOT) - urtw_write8_m(sc, URTW_SLOT, 0x9); - else - urtw_write8_m(sc, URTW_SLOT, 0x14); - - if (IEEE80211_IS_CHAN_G(c)) { - /* for G */ - urtw_write8_m(sc, URTW_DIFS, 0x14); - urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x14); - urtw_write8_m(sc, URTW_CW_VAL, 0x73); - } else { - /* for B */ - urtw_write8_m(sc, URTW_DIFS, 0x24); - urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x24); - urtw_write8_m(sc, URTW_CW_VAL, 0xa5); - } - fail: return (error); } @@ -3272,53 +3207,156 @@ urtw_8225v2b_rf_init(struct urtw_softc * { #define N(a) (sizeof(a) / sizeof((a)[0])) int i; + uint8_t data8; usb_error_t error; + error = urtw_set_mode(sc, URTW_EPROM_CMD_CONFIG); + if (error) + goto fail; + + /* + * initialize extra registers on 8187 + */ + urtw_write16_m(sc, URTW_BRSR_8187B, 0xfff); + + /* retry limit */ + urtw_read8_m(sc, URTW_CW_CONF, &data8); + data8 |= URTW_CW_CONF_PERPACKET_RETRY; + urtw_write8_m(sc, URTW_CW_CONF, data8); + + /* TX AGC */ + urtw_read8_m(sc, URTW_TX_AGC_CTL, &data8); + data8 |= URTW_TX_AGC_CTL_PERPACKET_GAIN; + urtw_write8_m(sc, URTW_TX_AGC_CTL, data8); + + /* Auto Rate Fallback Control */ +#define URTW_ARFR 0x1e0 + urtw_write16_m(sc, URTW_ARFR, 0xfff); + urtw_read8_m(sc, URTW_RATE_FALLBACK, &data8); + urtw_write8_m(sc, URTW_RATE_FALLBACK, + data8 | URTW_RATE_FALLBACK_ENABLE); + + urtw_read8_m(sc, URTW_MSR, &data8); + urtw_write8_m(sc, URTW_MSR, data8 & 0xf3); + urtw_read8_m(sc, URTW_MSR, &data8); + urtw_write8_m(sc, URTW_MSR, data8 | URTW_MSR_LINK_ENEDCA); + urtw_write8_m(sc, URTW_ACM_CONTROL, sc->sc_acmctl); + + urtw_write16_m(sc, URTW_ATIM_WND, 2); + urtw_write16_m(sc, URTW_BEACON_INTERVAL, 100); +#define URTW_FEMR_FOR_8187B 0x1d4 + urtw_write16_m(sc, URTW_FEMR_FOR_8187B, 0xffff); + + /* led type */ + urtw_read8_m(sc, URTW_CONFIG1, &data8); + data8 = (data8 & 0x3f) | 0x80; + urtw_write8_m(sc, URTW_CONFIG1, data8); + + /* applying MAC address again. */ + urtw_write32_m(sc, URTW_MAC0, ((uint32_t *)sc->sc_bssid)[0]); + urtw_write16_m(sc, URTW_MAC4, ((uint32_t *)sc->sc_bssid)[1] & 0xffff); + + error = urtw_set_mode(sc, URTW_EPROM_CMD_NORMAL); + if (error) + goto fail; + + urtw_write8_m(sc, URTW_WPA_CONFIG, 0); + + /* + * MAC configuration + */ for (i = 0; i < N(urtw_8225v2b_rf_part1); i++) - urtw_8225_write(sc, urtw_8225v2b_rf_part1[i].reg, + urtw_write8_m(sc, urtw_8225v2b_rf_part1[i].reg, urtw_8225v2b_rf_part1[i].val); + urtw_write16_m(sc, URTW_TID_AC_MAP, 0xfa50); + urtw_write16_m(sc, URTW_INT_MIG, 0x0000); + urtw_write32_m(sc, 0x1f0, 0); + urtw_write32_m(sc, 0x1f4, 0); + urtw_write8_m(sc, 0x1f8, 0); + urtw_write32_m(sc, URTW_RF_TIMING, 0x4001); - urtw_8225_write(sc, - URTW_8225_ADDR_0_MAGIC, URTW_8225_ADDR_0_DATA_MAGIC1); +#define URTW_RFSW_CTRL 0x272 + urtw_write16_m(sc, URTW_RFSW_CTRL, 0x569a); - for (i = 0; i < N(urtw_8225v2b_rxgain); i++) { + /* + * initialize PHY + */ + error = urtw_set_mode(sc, URTW_EPROM_CMD_CONFIG); + if (error) + goto fail; + urtw_read8_m(sc, URTW_CONFIG3, &data8); + urtw_write8_m(sc, URTW_CONFIG3, + data8 | URTW_CONFIG3_ANAPARAM_WRITE); + + error = urtw_set_mode(sc, URTW_EPROM_CMD_NORMAL); + if (error) + goto fail; + + /* setup RFE initial timing */ + urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, 0x0480); + urtw_write16_m(sc, URTW_RF_PINS_SELECT, 0x2488); + urtw_write16_m(sc, URTW_RF_PINS_ENABLE, 0x1fff); + usb_pause_mtx(&sc->sc_mtx, 1100); + + for (i = 0; i < N(urtw_8225v2b_rf_part0); i++) { + urtw_8225_write(sc, urtw_8225v2b_rf_part0[i].reg, + urtw_8225v2b_rf_part0[i].val); + usb_pause_mtx(&sc->sc_mtx, 1); + } + urtw_8225_write(sc, 0x00, 0x01b7); + + for (i = 0; i < 95; i++) { urtw_8225_write(sc, URTW_8225_ADDR_1_MAGIC, (uint8_t)(i + 1)); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_8225_write(sc, URTW_8225_ADDR_2_MAGIC, urtw_8225v2b_rxgain[i]); + usb_pause_mtx(&sc->sc_mtx, 1); } urtw_8225_write(sc, URTW_8225_ADDR_3_MAGIC, 0x080); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_8225_write(sc, URTW_8225_ADDR_5_MAGIC, 0x004); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_8225_write(sc, URTW_8225_ADDR_0_MAGIC, 0x0b7); + usb_pause_mtx(&sc->sc_mtx, 1); + usb_pause_mtx(&sc->sc_mtx, 3000); urtw_8225_write(sc, URTW_8225_ADDR_2_MAGIC, 0xc4d); + usb_pause_mtx(&sc->sc_mtx, 2000); urtw_8225_write(sc, URTW_8225_ADDR_2_MAGIC, 0x44d); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_8225_write(sc, URTW_8225_ADDR_0_MAGIC, 0x2bf); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_write8_m(sc, URTW_TX_GAIN_CCK, 0x03); urtw_write8_m(sc, URTW_TX_GAIN_OFDM, 0x07); urtw_write8_m(sc, URTW_TX_ANTENNA, 0x03); urtw_8187_write_phy_ofdm(sc, 0x80, 0x12); - for (i = 0; i < N(urtw_8225z2_agc); i++) { - urtw_8187_write_phy_ofdm(sc, 0xf, urtw_8225z2_agc[i]); - urtw_8187_write_phy_ofdm(sc, 0xe, 0x80 + i); - urtw_8187_write_phy_ofdm(sc, 0xe, 0); + for (i = 0; i < 128; i++) { + uint32_t addr, data; + + data = (urtw_8225z2_agc[i] << 8) | 0x0000008f; + addr = ((i + 0x80) << 8) | 0x0000008e; + + urtw_8187_write_phy_ofdm(sc, data & 0x7f, (data >> 8) & 0xff); + urtw_8187_write_phy_ofdm(sc, addr & 0x7f, (addr >> 8) & 0xff); + urtw_8187_write_phy_ofdm(sc, 0x0e, 0x00); } urtw_8187_write_phy_ofdm(sc, 0x80, 0x10); for (i = 0; i < N(urtw_8225v2b_rf_part2); i++) urtw_8187_write_phy_ofdm(sc, i, urtw_8225v2b_rf_part2[i].val); - urtw_write32_m(sc, 0xf0, (7 << 12) | (3 << 8) | 0x1c); - urtw_write32_m(sc, 0xf4, (7 << 12) | (3 << 8) | 0x1c); - urtw_write32_m(sc, 0xf8, (7 << 12) | (3 << 8) | 0x1c); - urtw_write32_m(sc, 0xfc, (7 << 12) | (3 << 8) | 0x1c); - urtw_write8_m(sc, URTW_ACM_CONTROL, 0); + urtw_write32_m(sc, URTW_8187B_AC_VO, (7 << 12) | (3 << 8) | 0x1c); + urtw_write32_m(sc, URTW_8187B_AC_VI, (7 << 12) | (3 << 8) | 0x1c); + urtw_write32_m(sc, URTW_8187B_AC_BE, (7 << 12) | (3 << 8) | 0x1c); + urtw_write32_m(sc, URTW_8187B_AC_BK, (7 << 12) | (3 << 8) | 0x1c); urtw_8187_write_phy_ofdm(sc, 0x97, 0x46); urtw_8187_write_phy_ofdm(sc, 0xa4, 0xb6); urtw_8187_write_phy_ofdm(sc, 0x85, 0xfc); urtw_8187_write_phy_cck(sc, 0xc1, 0x88); + fail: return (error); #undef N @@ -3327,8 +3365,6 @@ fail: static usb_error_t urtw_8225v2b_rf_set_chan(struct urtw_softc *sc, int chan) { - int ack; - struct ieee80211com *ic = sc->sc_ifp->if_l2com; usb_error_t error; error = urtw_8225v2b_set_txpwrlvl(sc, chan); @@ -3337,33 +3373,6 @@ urtw_8225v2b_rf_set_chan(struct urtw_sof urtw_8225_write(sc, URTW_8225_ADDR_7_MAGIC, urtw_8225_channel[chan]); usb_pause_mtx(&sc->sc_mtx, 10); - - urtw_write8_m(sc, URTW_SIFS, 0xa); - if (ic->ic_flags & IEEE80211_F_SHSLOT) { - urtw_write8_m(sc, URTW_SLOT, 0x9); - urtw_write8_m(sc, URTW_DIFS, 0x1c); - /* In 8187B, BRSR + 1 ==> EIFS register */ - urtw_write8_m(sc, URTW_BRSR + 1, 0x53); - - ack = 112 + 48 + 0x1c; - ack += (ic->ic_flags & IEEE80211_F_SHPREAMBLE) ? - 72 : 144; - urtw_write8_m(sc, URTW_CARRIER_SCOUNT, - roundup2(ack, 4)); - } else { - urtw_write8_m(sc, URTW_SLOT, 0x14); - urtw_write8_m(sc, URTW_DIFS, 0x32); - /* In 8187B, BRSR + 1 ==> EIFS register */ - urtw_write8_m(sc, URTW_BRSR + 1, 0x5b); - - ack = 112 + 48 + 0x32; - ack += (ic->ic_flags & IEEE80211_F_SHPREAMBLE) ? - 72 : 144; - urtw_write8_m(sc, URTW_CARRIER_SCOUNT, - roundup2(ack, 4)); - - } - fail: return (error); } @@ -3819,8 +3828,10 @@ urtw_rx_enable(struct urtw_softc *sc) if (error != 0) goto fail; - urtw_read8_m(sc, URTW_CMD, &data); - urtw_write8_m(sc, URTW_CMD, data | URTW_CMD_RX_ENABLE); + if ((sc->sc_flags & URTW_RTL8187B) == 0) { + urtw_read8_m(sc, URTW_CMD, &data); + urtw_write8_m(sc, URTW_CMD, data | URTW_CMD_RX_ENABLE); + } fail: return (error); } @@ -3844,8 +3855,9 @@ urtw_tx_enable(struct urtw_softc *sc) (7 << 21); /* MAX TX DMA */ urtw_write32_m(sc, URTW_TX_CONF, data); - urtw_read8_m(sc, URTW_CMD, &data8); - urtw_write8_m(sc, URTW_CMD, data8 | URTW_CMD_TX_ENABLE); + urtw_read8_m(sc, URTW_MSR, &data8); + data8 |= URTW_MSR_LINK_ENEDCA; + urtw_write8_m(sc, URTW_MSR, data8); return (error); } @@ -3929,14 +3941,13 @@ static struct mbuf * urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *data, int *rssi_p, int8_t *nf_p) { - int actlen, flen, len, nf = -95, rssi; + int actlen, flen, rssi; struct ieee80211_frame *wh; struct mbuf *m, *mnew; - struct urtw_8187b_rxhdr *bhdr; struct urtw_softc *sc = data->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - uint8_t *desc, quality = 0, rate; + uint8_t noise = 0, rate; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); @@ -3946,39 +3957,34 @@ urtw_rxeof(struct usb_xfer *xfer, struct } if (sc->sc_flags & URTW_RTL8187B) { - len = actlen - (sizeof(struct urtw_8187b_rxhdr)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 00:46:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FC3106566B; Sun, 18 Oct 2009 00:46:59 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFB658FC0C; Sun, 18 Oct 2009 00:46:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9I0kxjR055071; Sun, 18 Oct 2009 00:46:59 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9I0kxmb055069; Sun, 18 Oct 2009 00:46:59 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200910180046.n9I0kxmb055069@svn.freebsd.org> From: Weongyo Jeong Date: Sun, 18 Oct 2009 00:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198195 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 00:46:59 -0000 Author: weongyo Date: Sun Oct 18 00:46:59 2009 New Revision: 198195 URL: http://svn.freebsd.org/changeset/base/198195 Log: adds devices supportted by urtw(4) and bumps date. Modified: head/share/man/man4/urtw.4 Modified: head/share/man/man4/urtw.4 ============================================================================== --- head/share/man/man4/urtw.4 Sun Oct 18 00:11:49 2009 (r198194) +++ head/share/man/man4/urtw.4 Sun Oct 18 00:46:59 2009 (r198195) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2009 +.Dd October 17, 2009 .Dt URTW 4 .Os .Sh NAME @@ -70,9 +70,15 @@ driver supports Realtek RTL8187B/L based .Pp .Bl -column "Shuttle XPC Accessory PN20" "RTL8225" "USB" -compact -offset 6n .It Em "Card Radio Bus" +.It "Belkin F5D7050E RTL8225 USB" +.It "Linksys WUSB54GCv2 RTL8225 USB" .It "Netgear WG111v2 RTL8225 USB" +.It "Netgear WG111v3 RTL8225 USB" .It "Safehome WLG-1500SMA5 RTL8225 USB" .It "Shuttle XPC Accessory PN20 RTL8225 USB" +.It "Sitecom WL168v1 RTL8225 USB" +.It "Sitecom WL168v4 RTL8225 USB" +.It "SureCom EP-9001-g(2A) RTL8225 USB" .It "TRENDnet TEW-424UB V3.xR RTL8225 USB" .El .Sh EXAMPLES From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 11:23:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 100B21065670; Sun, 18 Oct 2009 11:23:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1BCF8FC08; Sun, 18 Oct 2009 11:23:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IBNuf9067493; Sun, 18 Oct 2009 11:23:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IBNuWE067492; Sun, 18 Oct 2009 11:23:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910181123.n9IBNuWE067492@svn.freebsd.org> From: Robert Watson Date: Sun, 18 Oct 2009 11:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198196 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 11:23:57 -0000 Author: rwatson Date: Sun Oct 18 11:23:56 2009 New Revision: 198196 URL: http://svn.freebsd.org/changeset/base/198196 Log: Rewrap ip_input() comment so that it prints more nicely. MFC after: 3 days Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sun Oct 18 00:46:59 2009 (r198195) +++ head/sys/netinet/ip_input.c Sun Oct 18 11:23:56 2009 (r198196) @@ -530,9 +530,9 @@ tooshort: } if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { /* - * Directly ship on the packet. This allows to forward packets - * that were destined for us to some other directly connected - * host. + * Directly ship on the packet. This allows to forward + * packets that were destined for us to some other directly + * connected host. */ ip_forward(m, dchg); return; From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 11:26:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C78B510656CD; Sun, 18 Oct 2009 11:26:09 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5C3F8FC08; Sun, 18 Oct 2009 11:26:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IBQ9j3067573; Sun, 18 Oct 2009 11:26:09 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IBQ9kJ067571; Sun, 18 Oct 2009 11:26:09 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200910181126.n9IBQ9kJ067571@svn.freebsd.org> From: Max Khon Date: Sun, 18 Oct 2009 11:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198197 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 11:26:09 -0000 Author: fjoe Date: Sun Oct 18 11:26:09 2009 New Revision: 198197 URL: http://svn.freebsd.org/changeset/base/198197 Log: Exit with non-zero error code in case of errors when make is run with -k and not parallel (compat) make is run. Modified: head/usr.bin/make/job.c Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Sun Oct 18 11:23:56 2009 (r198196) +++ head/usr.bin/make/job.c Sun Oct 18 11:26:09 2009 (r198197) @@ -3380,6 +3380,8 @@ Compat_Run(Lst *targs) printf("`%s' not remade because of errors.\n", gn->name); makeErrors++; + } else if (gn->made == ERROR) { + makeErrors++; } } From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 11:27:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E43F106566C; Sun, 18 Oct 2009 11:27:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 129888FC20; Sun, 18 Oct 2009 11:27:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IBRYNu067633; Sun, 18 Oct 2009 11:27:34 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IBRYwf067631; Sun, 18 Oct 2009 11:27:34 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910181127.n9IBRYwf067631@svn.freebsd.org> From: Robert Watson Date: Sun, 18 Oct 2009 11:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198198 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 11:27:35 -0000 Author: rwatson Date: Sun Oct 18 11:27:34 2009 New Revision: 198198 URL: http://svn.freebsd.org/changeset/base/198198 Log: Line-wrap pfil.c so that it prints more nicely. MFC after: 3 days Modified: head/sys/net/pfil.c Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Sun Oct 18 11:26:09 2009 (r198197) +++ head/sys/net/pfil.c Sun Oct 18 11:27:34 2009 (r198198) @@ -49,12 +49,14 @@ static struct mtx pfil_global_lock; -MTX_SYSINIT(pfil_heads_lock, &pfil_global_lock, "pfil_head_list lock", MTX_DEF); +MTX_SYSINIT(pfil_heads_lock, &pfil_global_lock, "pfil_head_list lock", + MTX_DEF); static int pfil_list_add(pfil_list_t *, struct packet_filter_hook *, int); static int pfil_list_remove(pfil_list_t *, - int (*)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), void *); + int (*)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), + void *); LIST_HEAD(pfilheadhead, pfil_head); VNET_DEFINE(struct pfilheadhead, pfil_head_list); @@ -77,7 +79,8 @@ pfil_run_hooks(struct pfil_head *ph, str for (pfh = pfil_hook_get(dir, ph); pfh != NULL; pfh = TAILQ_NEXT(pfh, pfil_link)) { if (pfh->pfil_func != NULL) { - rv = (*pfh->pfil_func)(pfh->pfil_arg, &m, ifp, dir, inp); + rv = (*pfh->pfil_func)(pfh->pfil_arg, &m, ifp, dir, + inp); if (rv != 0 || m == NULL) break; } @@ -221,8 +224,8 @@ error: * hook list. */ int -pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), - void *arg, int flags, struct pfil_head *ph) +pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int, + struct inpcb *), void *arg, int flags, struct pfil_head *ph) { int err = 0; @@ -273,7 +276,8 @@ pfil_list_add(pfil_list_t *list, struct */ static int pfil_list_remove(pfil_list_t *list, - int (*func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), void *arg) + int (*func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *), + void *arg) { struct packet_filter_hook *pfh; From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 11:28:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D8D2106568D; Sun, 18 Oct 2009 11:28:32 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B1F38FC1C; Sun, 18 Oct 2009 11:28:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IBSWvO067686; Sun, 18 Oct 2009 11:28:32 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IBSWfI067684; Sun, 18 Oct 2009 11:28:32 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200910181128.n9IBSWfI067684@svn.freebsd.org> From: Max Khon Date: Sun, 18 Oct 2009 11:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198199 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 11:28:32 -0000 Author: fjoe Date: Sun Oct 18 11:28:31 2009 New Revision: 198199 URL: http://svn.freebsd.org/changeset/base/198199 Log: Reset UPTODATE gnodes after remaking makefiles when make is not going to be restarted: such nodes could be marked UPTODATE without doing rebuild due to remakingMakefiles being TRUE. Modified: head/usr.bin/make/main.c Modified: head/usr.bin/make/main.c ============================================================================== --- head/usr.bin/make/main.c Sun Oct 18 11:27:34 2009 (r198198) +++ head/usr.bin/make/main.c Sun Oct 18 11:28:31 2009 (r198199) @@ -706,6 +706,7 @@ Main_AddSourceMakefile(const char *name) static void Remake_Makefiles(void) { + Lst cleanup; LstNode *ln; int error_cnt = 0; int remade_cnt = 0; @@ -716,6 +717,7 @@ Remake_Makefiles(void) Fatal("Failed to change directory to %s.", curdir); } + Lst_Init(&cleanup); LST_FOREACH(ln, &source_makefiles) { LstNode *ln2; struct GNode *gn; @@ -791,21 +793,7 @@ Remake_Makefiles(void) gn->name); error_cnt++; } else if (gn->made == UPTODATE) { - Lst examine; - - Lst_Init(&examine); - Lst_EnQueue(&examine, gn); - while (!Lst_IsEmpty(&examine)) { - LstNode *eln; - GNode *egn = Lst_DeQueue(&examine); - - egn->make = FALSE; - LST_FOREACH(eln, &egn->children) { - GNode *cgn = Lst_Datum(eln); - - Lst_EnQueue(&examine, cgn); - } - } + Lst_EnQueue(&cleanup, gn); } } @@ -827,6 +815,24 @@ Remake_Makefiles(void) } } + while (!Lst_IsEmpty(&cleanup)) { + GNode *gn = Lst_DeQueue(&cleanup); + + gn->unmade = 0; + gn->make = FALSE; + gn->made = UNMADE; + gn->childMade = FALSE; + gn->mtime = gn->cmtime = 0; + gn->cmtime_gn = NULL; + + LST_FOREACH(ln, &gn->children) { + GNode *cgn = Lst_Datum(ln); + + gn->unmade++; + Lst_EnQueue(&cleanup, cgn); + } + } + if (curdir != objdir) { if (chdir(objdir) < 0) Fatal("Failed to change directory to %s.", objdir); From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 12:55:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 484E8106566C; Sun, 18 Oct 2009 12:55:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3774B8FC13; Sun, 18 Oct 2009 12:55:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9ICte8U069288; Sun, 18 Oct 2009 12:55:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ICtelB069286; Sun, 18 Oct 2009 12:55:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910181255.n9ICtelB069286@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 Oct 2009 12:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198201 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 12:55:40 -0000 Author: kib Date: Sun Oct 18 12:55:39 2009 New Revision: 198201 URL: http://svn.freebsd.org/changeset/base/198201 Log: Remove spurious call to priv_check(PRIV_VM_SWAP_NOQUOTA). Call priv_check(PRIV_VM_SWAP_NORLIMIT) only when per-uid limit is actually exceed. Both changes aim at calling priv_check(9) only for the cases when privilege is actually exercised by the process. Reported and tested by: rwatson Reviewed by: alc MFC after: 3 days Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun Oct 18 12:48:23 2009 (r198200) +++ head/sys/vm/swap_pager.c Sun Oct 18 12:55:39 2009 (r198201) @@ -176,7 +176,7 @@ swap_reserve(vm_ooffset_t incr) int swap_reserve_by_uid(vm_ooffset_t incr, struct uidinfo *uip) { - vm_ooffset_t r, s, max; + vm_ooffset_t r, s; int res, error; static int curfail; static struct timeval lastfail; @@ -185,7 +185,6 @@ swap_reserve_by_uid(vm_ooffset_t incr, s panic("swap_reserve: & PAGE_MASK"); res = 0; - error = priv_check(curthread, PRIV_VM_SWAP_NOQUOTA); mtx_lock(&sw_dev_mtx); r = swap_reserved + incr; if (overcommit & SWAP_RESERVE_ALLOW_NONWIRED) { @@ -204,10 +203,9 @@ swap_reserve_by_uid(vm_ooffset_t incr, s if (res) { PROC_LOCK(curproc); UIDINFO_VMSIZE_LOCK(uip); - error = priv_check(curthread, PRIV_VM_SWAP_NORLIMIT); - max = (error != 0) ? lim_cur(curproc, RLIMIT_SWAP) : 0; - if (max != 0 && uip->ui_vmsize + incr > max && - (overcommit & SWAP_RESERVE_RLIMIT_ON) != 0) + if ((overcommit & SWAP_RESERVE_RLIMIT_ON) != 0 && + uip->ui_vmsize + incr > lim_cur(curproc, RLIMIT_SWAP) && + priv_check(curthread, PRIV_VM_SWAP_NORLIMIT)) res = 0; else uip->ui_vmsize += incr; From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 12:57:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CBB2106566B; Sun, 18 Oct 2009 12:57:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3224B8FC0A; Sun, 18 Oct 2009 12:57:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9ICvnse069354; Sun, 18 Oct 2009 12:57:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ICvn3R069352; Sun, 18 Oct 2009 12:57:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910181257.n9ICvn3R069352@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 Oct 2009 12:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198202 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 12:57:49 -0000 Author: kib Date: Sun Oct 18 12:57:48 2009 New Revision: 198202 URL: http://svn.freebsd.org/changeset/base/198202 Log: If ET_DYN binary has non-zero base address for some reason, honour it and do not relocate the binary to ET_DYN_LOAD_ADDR. This allows for the binary author to influence address map of the process. In particular, when the binary is actually an interpeter, this allows to have almost usual process address map. Communicate the relocation bias of the mapping for interpeter-less ET_DYN binary, that is interperter itself, in AT_BASE aux entry. This way, rtld is able to find its dynamic structure and relocate itself. Note that mapbase in the rtld is still wrong and requires further fixing. Reported and tested by: rwatson Discussed with: kan MFC after: 3 days Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Oct 18 12:55:39 2009 (r198201) +++ head/sys/kern/imgact_elf.c Sun Oct 18 12:57:48 2009 (r198202) @@ -688,9 +688,9 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long text_size = 0, data_size = 0, total_size = 0; u_long text_addr = 0, data_addr = 0; u_long seg_size, seg_addr; - u_long addr, et_dyn_addr, entry = 0, proghdr = 0; + u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0; int32_t osrel = 0; - int error = 0, i; + int error = 0, i, n; const char *interp = NULL, *newinterp = NULL; Elf_Brandinfo *brand_info; char *path; @@ -719,14 +719,22 @@ __CONCAT(exec_, __elfN(imgact))(struct i phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); if (!aligned(phdr, Elf_Addr)) return (ENOEXEC); + n = 0; + baddr = 0; for (i = 0; i < hdr->e_phnum; i++) { + if (phdr[i].p_type == PT_LOAD) { + if (n == 0) + baddr = phdr[i].p_vaddr; + n++; + continue; + } if (phdr[i].p_type == PT_INTERP) { /* Path to interpreter */ if (phdr[i].p_filesz > MAXPATHLEN || phdr[i].p_offset + phdr[i].p_filesz > PAGE_SIZE) return (ENOEXEC); interp = imgp->image_header + phdr[i].p_offset; - break; + continue; } } @@ -739,7 +747,14 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (hdr->e_type == ET_DYN) { if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) return (ENOEXEC); - et_dyn_addr = ET_DYN_LOAD_ADDR; + /* + * Honour the base load address from the dso if it is + * non-zero for some reason. + */ + if (baddr == 0) + et_dyn_addr = ET_DYN_LOAD_ADDR; + else + et_dyn_addr = 0; } else et_dyn_addr = 0; sv = brand_info->sysvec; @@ -910,7 +925,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i return (error); } } else - addr = 0; + addr = et_dyn_addr; /* * Construct auxargs table (used by the fixup routine) From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 13:08:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 168BF106566B; Sun, 18 Oct 2009 13:08:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C45E08FC1A; Sun, 18 Oct 2009 13:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9ID8FBb069575; Sun, 18 Oct 2009 13:08:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ID8FCP069572; Sun, 18 Oct 2009 13:08:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200910181308.n9ID8FCP069572@svn.freebsd.org> From: Marius Strobl Date: Sun, 18 Oct 2009 13:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198203 - in head/sys: sparc64/include sun4v/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 13:08:17 -0000 Author: marius Date: Sun Oct 18 13:08:15 2009 New Revision: 198203 URL: http://svn.freebsd.org/changeset/base/198203 Log: Change the load base to below 2GB so PIE binaries work including when compiled to use the Medium/Low code model, which we currently default to for the userland. GNU/Linux has moved their default to Medium/Middle some time ago, which probably explains why the current GNU ld(1) uses a base in the range between 32 and 44 bits instead. Submitted by: kib Modified: head/sys/sparc64/include/elf.h head/sys/sun4v/include/elf.h Modified: head/sys/sparc64/include/elf.h ============================================================================== --- head/sys/sparc64/include/elf.h Sun Oct 18 12:57:48 2009 (r198202) +++ head/sys/sparc64/include/elf.h Sun Oct 18 13:08:15 2009 (r198203) @@ -97,6 +97,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH ELF_ARCH #define ELF_TARG_VER 1 -#define ET_DYN_LOAD_ADDR 0x150000000 +#define ET_DYN_LOAD_ADDR 0x100000 #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/sun4v/include/elf.h ============================================================================== --- head/sys/sun4v/include/elf.h Sun Oct 18 12:57:48 2009 (r198202) +++ head/sys/sun4v/include/elf.h Sun Oct 18 13:08:15 2009 (r198203) @@ -97,6 +97,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH ELF_ARCH #define ELF_TARG_VER 1 -#define ET_DYN_LOAD_ADDR 0x150000000 +#define ET_DYN_LOAD_ADDR 0x100000 #endif /* !_MACHINE_ELF_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 13:51:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E43011065676; Sun, 18 Oct 2009 13:51:49 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3B038FC0C; Sun, 18 Oct 2009 13:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IDpn3M070670; Sun, 18 Oct 2009 13:51:49 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IDpns6070668; Sun, 18 Oct 2009 13:51:49 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910181351.n9IDpns6070668@svn.freebsd.org> From: Rui Paulo Date: Sun, 18 Oct 2009 13:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198204 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 13:51:50 -0000 Author: rpaulo Date: Sun Oct 18 13:51:49 2009 New Revision: 198204 URL: http://svn.freebsd.org/changeset/base/198204 Log: Fix KASSERT string to include the real module name. Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sun Oct 18 13:08:15 2009 (r198203) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sun Oct 18 13:51:49 2009 (r198204) @@ -504,7 +504,7 @@ pmc_ri_to_classdep(struct pmc_mdep *md, pcd = pmc_rowindex_to_classdep[ri]; KASSERT(pcd != NULL, - ("[amd,%d] ri %d null pcd", __LINE__, ri)); + ("[pmc,%d] ri %d null pcd", __LINE__, ri)); *adjri = ri - pcd->pcd_ri; From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 13:55:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7C5D106566B; Sun, 18 Oct 2009 13:55:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B26FF8FC3C; Sun, 18 Oct 2009 13:55:38 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 3CEBE46B29; Sun, 18 Oct 2009 09:55:38 -0400 (EDT) Date: Sun, 18 Oct 2009 14:55:38 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bruce Evans In-Reply-To: <20091016154905.E8438@delplex.bde.org> Message-ID: References: <200910151031.n9FAVOvU070664@svn.freebsd.org> <20091016154905.E8438@delplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198118 - head/usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 13:55:38 -0000 On Fri, 16 Oct 2009, Bruce Evans wrote: > On Thu, 15 Oct 2009, Robert Watson wrote: > >> Log: >> Print routing statistics as unsigned short rather than unsigned int, >> otherwise sign extension leads to unlikely values when in the negative >> range of the signed short structure fields that hold the statistics. >> The type used to hold routing statistics is arguably also incorrect. > > This enlarges the bug. With signed types you get advance warning of > overflow (you actually get overflow earlier but it usually just results in > obviously wrong values being printed), and repeated warnings on overflow > (every time the overflowing values wrap back to negative). With unsigned > types or this change, you get unobviously wrong values after the first > overflow, and no repeated warnings (unless you watch the values carefully > enough to see them go backwards). Using unsigned bytes only delays the > overflow for a whole factor of 2. Yes, a preferable fix would be to move to a u_long (or the like) for the statistics, but unfortunately it's too late in the game to fix that for 8.0. I'll change the statistics types in 9.0 at some point. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 17:10:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC571065672; Sun, 18 Oct 2009 17:10:40 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C2A18FC1A; Sun, 18 Oct 2009 17:10:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IHAdaA074410; Sun, 18 Oct 2009 17:10:39 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IHAdvY074408; Sun, 18 Oct 2009 17:10:39 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200910181710.n9IHAdvY074408@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 18 Oct 2009 17:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198210 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 17:10:40 -0000 Author: maxim Date: Sun Oct 18 17:10:39 2009 New Revision: 198210 URL: http://svn.freebsd.org/changeset/base/198210 Log: o OpenBSD 4.6 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sun Oct 18 15:58:57 2009 (r198209) +++ head/share/misc/bsd-family-tree Sun Oct 18 17:10:39 2009 (r198210) @@ -230,7 +230,7 @@ FreeBSD 5.2 | | | FreeBSD 7.2 | NetBSD 5.0 OpenBSD 4.5 | | | | | | | | | | | | DragonFly 2.4.0 - | V | | | | + | V | | OpenBSD 4.6 | | | | | | FreeBSD 8 -current | NetBSD -current OpenBSD -current | | | | | | @@ -504,6 +504,7 @@ NetBSD 5.0 2009-04-29 [NBD] OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] DragonFly 2.4.0 2009-09-16 [DFB] +OpenBSD 4.6 2009-10-18 [OBD] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 17:11:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B79C1065672; Sun, 18 Oct 2009 17:11:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C06D8FC1A; Sun, 18 Oct 2009 17:11:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IHBGHk074473; Sun, 18 Oct 2009 17:11:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IHBG6W074471; Sun, 18 Oct 2009 17:11:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200910181711.n9IHBG6W074471@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 18 Oct 2009 17:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198211 - head/sys/dev/gem X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 17:11:16 -0000 Author: nwhitehorn Date: Sun Oct 18 17:11:16 2009 New Revision: 198211 URL: http://svn.freebsd.org/changeset/base/198211 Log: Work around a quirk with the G5 Xserve, which has a fake GMAC controller with an all-zero MAC address. In this case, don't attach. Discussed with: marius Modified: head/sys/dev/gem/if_gem_pci.c Modified: head/sys/dev/gem/if_gem_pci.c ============================================================================== --- head/sys/dev/gem/if_gem_pci.c Sun Oct 18 17:10:39 2009 (r198210) +++ head/sys/dev/gem/if_gem_pci.c Sun Oct 18 17:11:16 2009 (r198211) @@ -295,6 +295,16 @@ gem_pci_attach(device_t dev) GEM_PCI_ROM_OFFSET + j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_SIZE, sc->sc_enaddr, ETHER_ADDR_LEN); #endif + /* + * The Xserve G5 has a fake GMAC with an all-zero MAC address. + * Check for this, and don't attach in this case. + */ + + for (i = 0; i < ETHER_ADDR_LEN && sc->sc_enaddr[i] == 0; i++) {} + if (i == ETHER_ADDR_LEN) { + device_printf(dev, "invalid MAC address\n"); + goto fail; + } if (gem_attach(sc) != 0) { device_printf(dev, "could not be attached\n"); From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 17:22:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E4C4106566C; Sun, 18 Oct 2009 17:22:09 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E84B8FC12; Sun, 18 Oct 2009 17:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IHM9l5074708; Sun, 18 Oct 2009 17:22:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IHM9Ll074706; Sun, 18 Oct 2009 17:22:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200910181722.n9IHM9Ll074706@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 18 Oct 2009 17:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198212 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 17:22:09 -0000 Author: nwhitehorn Date: Sun Oct 18 17:22:08 2009 New Revision: 198212 URL: http://svn.freebsd.org/changeset/base/198212 Log: Don't assume that physical addresses are identity mapped. This allows the second processor on G5 systems to start. Note that SMP is still non-functional on these systems because of IPI delivery problems. Modified: head/sys/powerpc/aim/platform_chrp.c Modified: head/sys/powerpc/aim/platform_chrp.c ============================================================================== --- head/sys/powerpc/aim/platform_chrp.c Sun Oct 18 17:11:16 2009 (r198211) +++ head/sys/powerpc/aim/platform_chrp.c Sun Oct 18 17:22:08 2009 (r198212) @@ -35,11 +35,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +#include #include #include @@ -220,6 +223,7 @@ chrp_smp_start_cpu(platform_t plat, stru #ifdef SMP phandle_t cpu; volatile uint8_t *rstvec; + static volatile uint8_t *rstvec_virtbase = NULL; int res, reset, timeout; cpu = pc->pc_hwref; @@ -229,7 +233,10 @@ chrp_smp_start_cpu(platform_t plat, stru ap_pcpu = pc; - rstvec = (uint8_t *)(0x80000000 + reset); + if (rstvec_virtbase == NULL) + rstvec_virtbase = pmap_mapdev(0x80000000, PAGE_SIZE); + + rstvec = rstvec_virtbase + reset; *rstvec = 4; powerpc_sync(); From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 19:45:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E2ED1065693; Sun, 18 Oct 2009 19:45:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D4478FC15; Sun, 18 Oct 2009 19:45:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IJji8M077188; Sun, 18 Oct 2009 19:45:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IJjijt077186; Sun, 18 Oct 2009 19:45:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910181945.n9IJjijt077186@svn.freebsd.org> From: Ed Schouten Date: Sun, 18 Oct 2009 19:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198213 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 19:45:45 -0000 Author: ed Date: Sun Oct 18 19:45:44 2009 New Revision: 198213 URL: http://svn.freebsd.org/changeset/base/198213 Log: Make lock devices work properly. It turned out I did add the code to use the init state devices to set the termios structure when opening the device, but it seems I totally forgot to add the bits required to force the actual locking of flags through the lock state devices. Reported by: ru MFC after: 1 week (to be discussed) Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Oct 18 17:22:08 2009 (r198212) +++ head/sys/kern/tty.c Sun Oct 18 19:45:44 2009 (r198213) @@ -523,6 +523,34 @@ ttydev_ioctl(struct cdev *dev, u_long cm goto done; } + if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { + struct termios *old = &tp->t_termios; + struct termios *new = (struct termios *)data; + struct termios *lock = TTY_CALLOUT(tp, dev) ? + &tp->t_termios_lock_out : &tp->t_termios_lock_in; + int cc; + + /* + * Lock state devices. Just overwrite the values of the + * commands that are currently in use. + */ + new->c_iflag = (old->c_iflag & lock->c_iflag) | + (new->c_iflag & ~lock->c_iflag); + new->c_oflag = (old->c_oflag & lock->c_oflag) | + (new->c_oflag & ~lock->c_oflag); + new->c_cflag = (old->c_cflag & lock->c_cflag) | + (new->c_cflag & ~lock->c_cflag); + new->c_lflag = (old->c_lflag & lock->c_lflag) | + (new->c_lflag & ~lock->c_lflag); + for (cc = 0; cc < NCCS; ++cc) + if (lock->c_cc[cc]) + new->c_cc[cc] = old->c_cc[cc]; + if (lock->c_ispeed) + new->c_ispeed = old->c_ispeed; + if (lock->c_ospeed) + new->c_ospeed = old->c_ospeed; + } + error = tty_ioctl(tp, cmd, data, td); done: tty_unlock(tp); From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 19:48:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 927951065692; Sun, 18 Oct 2009 19:48:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43B0C8FC14; Sun, 18 Oct 2009 19:48:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IJmspX077276; Sun, 18 Oct 2009 19:48:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IJmsUd077273; Sun, 18 Oct 2009 19:48:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910181948.n9IJmsUd077273@svn.freebsd.org> From: Ed Schouten Date: Sun, 18 Oct 2009 19:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198214 - in head: etc sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 19:48:54 -0000 Author: ed Date: Sun Oct 18 19:48:53 2009 New Revision: 198214 URL: http://svn.freebsd.org/changeset/base/198214 Log: Allow the buffer size to be configured for pseudo-like TTY devices. Devices that don't implement param() (which means they don't support hardware parameters such as flow control, baud rate) hardcode the baud rate to TTYDEF_SPEED. This means the buffer size cannot be configured, which is a little inconvenient when using canonical mode with big lines of input, etc. Make it adjustable, but do clamp it between B50 and B115200 to prevent awkward buffer sizes. Remove the baud rate assignment from /etc/gettytab. Trust the kernel to fill in a proper value. Reported by: Mikolaj Golub MFC after: 1 month Modified: head/etc/gettytab head/sys/kern/tty.c Modified: head/etc/gettytab ============================================================================== --- head/etc/gettytab Sun Oct 18 19:45:44 2009 (r198213) +++ head/etc/gettytab Sun Oct 18 19:48:53 2009 (r198214) @@ -162,7 +162,7 @@ X|Xwindow|X window system:\ :fd@:nd@:cd@:rw:sp#9600: P|Pc|Pc console:\ - :ht:np:sp#115200: + :ht:np: # # Wierdo special case for fast crt's with hardcopy devices Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Oct 18 19:45:44 2009 (r198213) +++ head/sys/kern/tty.c Sun Oct 18 19:48:53 2009 (r198214) @@ -870,8 +870,19 @@ static int ttydevsw_defparam(struct tty *tp, struct termios *t) { - /* Use a fake baud rate, we're not a real device. */ - t->c_ispeed = t->c_ospeed = TTYDEF_SPEED; + /* + * Allow the baud rate to be adjusted for pseudo-devices, but at + * least restrict it to 115200 to prevent excessive buffer + * usage. Also disallow 0, to prevent foot shooting. + */ + if (t->c_ispeed < B50) + t->c_ispeed = B50; + else if (t->c_ispeed > B115200) + t->c_ispeed = B115200; + if (t->c_ospeed < B50) + t->c_ospeed = B50; + else if (t->c_ospeed > B115200) + t->c_ospeed = B115200; return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 19:50:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2BC41065670; Sun, 18 Oct 2009 19:50:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1ED58FC1F; Sun, 18 Oct 2009 19:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IJoFEL077344; Sun, 18 Oct 2009 19:50:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IJoFJ1077342; Sun, 18 Oct 2009 19:50:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910181950.n9IJoFJ1077342@svn.freebsd.org> From: Ed Schouten Date: Sun, 18 Oct 2009 19:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198215 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 19:50:15 -0000 Author: ed Date: Sun Oct 18 19:50:15 2009 New Revision: 198215 URL: http://svn.freebsd.org/changeset/base/198215 Log: Fix a typo in the jail(8) manpage. Submitted by: Jille Timmermans MFC after: 1 week Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Oct 18 19:48:53 2009 (r198214) +++ head/usr.sbin/jail/jail.8 Sun Oct 18 19:50:15 2009 (r198215) @@ -377,7 +377,7 @@ Since raw sockets can be used to configu network subsystems, extra caution should be used where privileged access to jails is given out to untrusted parties. .It Va allow.chflags -Normally, priveleged users inside a jail are treated as unprivileged by +Normally, privileged users inside a jail are treated as unprivileged by .Xr chflags 2 . When this parameter is set, such users are treated as privileged, and may manipulate system file flags subject to the usual constraints on From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 19:51:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 146631065696; Sun, 18 Oct 2009 19:51:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03DF68FC28; Sun, 18 Oct 2009 19:51:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IJp6TS077403; Sun, 18 Oct 2009 19:51:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IJp645077401; Sun, 18 Oct 2009 19:51:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910181951.n9IJp645077401@svn.freebsd.org> From: Ed Schouten Date: Sun, 18 Oct 2009 19:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198216 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 19:51:07 -0000 Author: ed Date: Sun Oct 18 19:51:06 2009 New Revision: 198216 URL: http://svn.freebsd.org/changeset/base/198216 Log: Fix qouting in a comment, to make it look more consistent Submitted by: Jille Timmermans MFC after: 1 week Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Oct 18 19:50:15 2009 (r198215) +++ head/etc/rc.subr Sun Oct 18 19:51:06 2009 (r198216) @@ -593,7 +593,7 @@ run_rc_command() rc_fast=yes rc_quiet=yes ;; - force*) # "force prefix; always run + force*) # "force" prefix; always run rc_force=yes _rc_prefix=force rc_arg=${rc_arg#${_rc_prefix}} From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 20:33:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E991106566C; Sun, 18 Oct 2009 20:33:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 645EC8FC0A; Sun, 18 Oct 2009 20:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IKXOQC078495; Sun, 18 Oct 2009 20:33:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IKXOeZ078493; Sun, 18 Oct 2009 20:33:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910182033.n9IKXOeZ078493@svn.freebsd.org> From: Ed Schouten Date: Sun, 18 Oct 2009 20:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198217 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 20:33:24 -0000 Author: ed Date: Sun Oct 18 20:33:24 2009 New Revision: 198217 URL: http://svn.freebsd.org/changeset/base/198217 Log: Don't forget to increment the man page date. Reported by: bz Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Oct 18 19:51:06 2009 (r198216) +++ head/usr.sbin/jail/jail.8 Sun Oct 18 20:33:24 2009 (r198217) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2009 +.Dd October 18, 2009 .Dt JAIL 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 22:43:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0227D106566B; Sun, 18 Oct 2009 22:43:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E62588FC14; Sun, 18 Oct 2009 22:43:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IMhSVx080722; Sun, 18 Oct 2009 22:43:28 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IMhSTc080720; Sun, 18 Oct 2009 22:43:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910182243.n9IMhSTc080720@svn.freebsd.org> From: Robert Watson Date: Sun, 18 Oct 2009 22:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198218 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 22:43:29 -0000 Author: rwatson Date: Sun Oct 18 22:43:28 2009 New Revision: 198218 URL: http://svn.freebsd.org/changeset/base/198218 Log: Sort function prototypes in pfil.h, clean up white space, and better align fields for printing. MFC after: 3 days Modified: head/sys/net/pfil.h Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Sun Oct 18 20:33:24 2009 (r198217) +++ head/sys/net/pfil.h Sun Oct 18 22:43:28 2009 (r198218) @@ -50,7 +50,7 @@ struct inpcb; struct packet_filter_hook { TAILQ_ENTRY(packet_filter_hook) pfil_link; int (*pfil_func)(void *, struct mbuf **, struct ifnet *, int, - struct inpcb *); + struct inpcb *); void *pfil_arg; int pfil_flags; }; @@ -80,14 +80,13 @@ struct pfil_head { LIST_ENTRY(pfil_head) ph_list; }; +int pfil_add_hook(int (*func)(void *, struct mbuf **, struct ifnet *, + int, struct inpcb *), void *, int, struct pfil_head *); +int pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, + int, struct inpcb *), void *, int, struct pfil_head *); int pfil_run_hooks(struct pfil_head *, struct mbuf **, struct ifnet *, int, struct inpcb *inp); -int pfil_add_hook(int (*func)(void *, struct mbuf **, - struct ifnet *, int, struct inpcb *), void *, int, struct pfil_head *); -int pfil_remove_hook(int (*func)(void *, struct mbuf **, - struct ifnet *, int, struct inpcb *), void *, int, struct pfil_head *); - int pfil_head_register(struct pfil_head *); int pfil_head_unregister(struct pfil_head *); @@ -107,6 +106,7 @@ struct pfil_head *pfil_head_get(int, u_l static __inline struct packet_filter_hook * pfil_hook_get(int dir, struct pfil_head *ph) { + if (dir == PFIL_IN) return (TAILQ_FIRST(&ph->ph_in)); else if (dir == PFIL_OUT) From owner-svn-src-head@FreeBSD.ORG Sun Oct 18 22:54:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 350BD1065672; Sun, 18 Oct 2009 22:54:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 250208FC12; Sun, 18 Oct 2009 22:54:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9IMsAPK080990; Sun, 18 Oct 2009 22:54:10 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9IMsAIW080988; Sun, 18 Oct 2009 22:54:10 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910182254.n9IMsAIW080988@svn.freebsd.org> From: Robert Watson Date: Sun, 18 Oct 2009 22:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198219 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2009 22:54:10 -0000 Author: rwatson Date: Sun Oct 18 22:54:09 2009 New Revision: 198219 URL: http://svn.freebsd.org/changeset/base/198219 Log: Remove unused pfil_flags field in packet_filter_hook. MFC after: 3 days Modified: head/sys/net/pfil.h Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Sun Oct 18 22:43:28 2009 (r198218) +++ head/sys/net/pfil.h Sun Oct 18 22:54:09 2009 (r198219) @@ -52,7 +52,6 @@ struct packet_filter_hook { int (*pfil_func)(void *, struct mbuf **, struct ifnet *, int, struct inpcb *); void *pfil_arg; - int pfil_flags; }; #define PFIL_IN 0x00000001 From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 04:15:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B88CC106566B; Mon, 19 Oct 2009 04:15:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 797E48FC0C; Mon, 19 Oct 2009 04:15:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n9J48bH2082096; Sun, 18 Oct 2009 22:08:39 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 18 Oct 2009 22:08:41 -0600 (MDT) Message-Id: <20091018.220841.387099187.imp@bsdimp.com> To: marius@alchemy.franken.de From: "M. Warner Losh" In-Reply-To: <20091014185338.GA26673@alchemy.franken.de> References: <20091013.223459.-957891176.imp@bsdimp.com> <20091014185338.GA26673@alchemy.franken.de> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, xcllnt@mac.com, src-committers@freebsd.org Subject: Re: svn commit: r197969 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 04:15:31 -0000 In message: <20091014185338.GA26673@alchemy.franken.de> Marius Strobl writes: : It would be really great if FreeBSD would distinguish between : LPC and real ISA so things like the ISAPNP code and ISA bus : front-ends of ATA, network and SCSI drivers etc wouldn't be : compliled into kernels for architectures that just have no : use for these as they have LPC but no ISA slots, but the lack : of activity in ISA driver development probably doesn't : warrant fixing this. driver ata nodriver ata.isa would be nice.. Warner From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 07:17:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32DD1106566C; Mon, 19 Oct 2009 07:17:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 084F48FC24; Mon, 19 Oct 2009 07:17:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9J7Hbx2094536; Mon, 19 Oct 2009 07:17:37 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9J7HbpP094533; Mon, 19 Oct 2009 07:17:37 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910190717.n9J7HbpP094533@svn.freebsd.org> From: Ed Schouten Date: Mon, 19 Oct 2009 07:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198223 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 07:17:38 -0000 Author: ed Date: Mon Oct 19 07:17:37 2009 New Revision: 198223 URL: http://svn.freebsd.org/changeset/base/198223 Log: Properly set the low watermarks when reducing the baud rate. Now that buffers are deallocated lazily, we should not use tty*q_getsize() to obtain the buffer size to calculate the low watermarks. Doing this may cause the watermark to be placed outside the typical buffer size. This caused some regressions after my previous commit to the TTY code, which allows pseudo-devices to resize the buffers as well. Reported by: yongari, dougb MFC after: 1 week Modified: head/sys/kern/tty.c head/sys/sys/ttyqueue.h Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Oct 18 23:38:59 2009 (r198222) +++ head/sys/kern/tty.c Mon Oct 19 07:17:37 2009 (r198223) @@ -109,14 +109,14 @@ tty_watermarks(struct tty *tp) ttyinq_setsize(&tp->t_inq, tp, bs); /* Set low watermark at 10% (when 90% is available). */ - tp->t_inlow = (ttyinq_getsize(&tp->t_inq) * 9) / 10; + tp->t_inlow = (ttyinq_getallocatedsize(&tp->t_inq) * 9) / 10; /* Provide an ouput buffer for 0.2 seconds of data. */ bs = MIN(tp->t_termios.c_ospeed / 5, TTYBUF_MAX); ttyoutq_setsize(&tp->t_outq, tp, bs); /* Set low watermark at 10% (when 90% is available). */ - tp->t_outlow = (ttyoutq_getsize(&tp->t_outq) * 9) / 10; + tp->t_outlow = (ttyoutq_getallocatedsize(&tp->t_outq) * 9) / 10; } static int Modified: head/sys/sys/ttyqueue.h ============================================================================== --- head/sys/sys/ttyqueue.h Sun Oct 18 23:38:59 2009 (r198222) +++ head/sys/sys/ttyqueue.h Mon Oct 19 07:17:37 2009 (r198223) @@ -93,6 +93,13 @@ ttyinq_getsize(struct ttyinq *ti) } static __inline size_t +ttyinq_getallocatedsize(struct ttyinq *ti) +{ + + return (ti->ti_quota * TTYINQ_DATASIZE); +} + +static __inline size_t ttyinq_bytesleft(struct ttyinq *ti) { size_t len; @@ -143,6 +150,13 @@ ttyoutq_getsize(struct ttyoutq *to) } static __inline size_t +ttyoutq_getallocatedsize(struct ttyoutq *to) +{ + + return (to->to_quota * TTYOUTQ_DATASIZE); +} + +static __inline size_t ttyoutq_bytesleft(struct ttyoutq *to) { size_t len; From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 07:55:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B90CB1065672; Mon, 19 Oct 2009 07:55:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89378FC08; Mon, 19 Oct 2009 07:55:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9J7tDji095201; Mon, 19 Oct 2009 07:55:13 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9J7tDxd095199; Mon, 19 Oct 2009 07:55:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910190755.n9J7tDxd095199@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 19 Oct 2009 07:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198224 - head/tools/regression/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 07:55:13 -0000 Author: des Date: Mon Oct 19 07:55:13 2009 New Revision: 198224 URL: http://svn.freebsd.org/changeset/base/198224 Log: Remove redundant $FreeBSD$. Modified: head/tools/regression/lib/libutil/test-flopen.c Modified: head/tools/regression/lib/libutil/test-flopen.c ============================================================================== --- head/tools/regression/lib/libutil/test-flopen.c Mon Oct 19 07:17:37 2009 (r198223) +++ head/tools/regression/lib/libutil/test-flopen.c Mon Oct 19 07:55:13 2009 (r198224) @@ -23,8 +23,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #include From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 07:56:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43B42106568B; Mon, 19 Oct 2009 07:56:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 336D48FC18; Mon, 19 Oct 2009 07:56:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9J7u4Av095256; Mon, 19 Oct 2009 07:56:04 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9J7u4kP095254; Mon, 19 Oct 2009 07:56:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910190756.n9J7u4kP095254@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 19 Oct 2009 07:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198225 - head/tools/regression/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 07:56:04 -0000 Author: des Date: Mon Oct 19 07:56:03 2009 New Revision: 198225 URL: http://svn.freebsd.org/changeset/base/198225 Log: Update copyright. Modified: head/tools/regression/lib/libutil/test-flopen.c Modified: head/tools/regression/lib/libutil/test-flopen.c ============================================================================== --- head/tools/regression/lib/libutil/test-flopen.c Mon Oct 19 07:55:13 2009 (r198224) +++ head/tools/regression/lib/libutil/test-flopen.c Mon Oct 19 07:56:03 2009 (r198225) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2007-2009 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 11:10:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DCB106566C; Mon, 19 Oct 2009 11:10:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08E2E8FC08; Mon, 19 Oct 2009 11:10:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JBAi42000216; Mon, 19 Oct 2009 11:10:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JBAiZ0000214; Mon, 19 Oct 2009 11:10:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910191110.n9JBAiZ0000214@svn.freebsd.org> From: Ed Schouten Date: Mon, 19 Oct 2009 11:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198229 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 11:10:45 -0000 Author: ed Date: Mon Oct 19 11:10:44 2009 New Revision: 198229 URL: http://svn.freebsd.org/changeset/base/198229 Log: Partially revert the change to the gettytab made in r198214. By misinterpreting some data, I thought that getty wouldn't apply any baud rate to the syscons devices, but it uses the default entry instead. This means that the baud rate is set to 1200. This isn't too bad, except when using canonical mode. Make it use 9600 baud by default. MFC after: 1 week Modified: head/etc/gettytab Modified: head/etc/gettytab ============================================================================== --- head/etc/gettytab Mon Oct 19 08:52:57 2009 (r198228) +++ head/etc/gettytab Mon Oct 19 11:10:44 2009 (r198229) @@ -162,7 +162,7 @@ X|Xwindow|X window system:\ :fd@:nd@:cd@:rw:sp#9600: P|Pc|Pc console:\ - :ht:np: + :ht:np:sp#9600: # # Wierdo special case for fast crt's with hardcopy devices From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 11:17:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4796106566C; Mon, 19 Oct 2009 11:17:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A358D8FC0C; Mon, 19 Oct 2009 11:17:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JBHk31000379; Mon, 19 Oct 2009 11:17:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JBHkxd000377; Mon, 19 Oct 2009 11:17:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910191117.n9JBHkxd000377@svn.freebsd.org> From: Rui Paulo Date: Mon, 19 Oct 2009 11:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198230 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 11:17:46 -0000 Author: rpaulo Date: Mon Oct 19 11:17:46 2009 New Revision: 198230 URL: http://svn.freebsd.org/changeset/base/198230 Log: HWMP fixes, namely: * fix the processing of RANN frames * the originator and target addresses were swapped and while it worked fine, it was not spec compliant. MFC after: 3 days Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Mon Oct 19 11:10:44 2009 (r198229) +++ head/sys/net80211/ieee80211_hwmp.c Mon Oct 19 11:17:46 2009 (r198230) @@ -148,7 +148,7 @@ typedef uint32_t ieee80211_hwmp_seq; struct ieee80211_hwmp_route { ieee80211_hwmp_seq hr_seq; /* last HWMP seq seen from dst*/ ieee80211_hwmp_seq hr_preqid; /* last PREQ ID seen from dst */ - ieee80211_hwmp_seq hr_targetseq; /* seq. no. on our latest PREQ*/ + ieee80211_hwmp_seq hr_origseq; /* seq. no. on our latest PREQ*/ int hr_preqretries; }; struct ieee80211_hwmp_state { @@ -733,12 +733,12 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_flags = 0; prep.prep_hopcount = 0; prep.prep_ttl = ms->ms_ttl; - IEEE80211_ADDR_COPY(prep.prep_targetaddr, preq->preq_origaddr); - prep.prep_targetseq = preq->preq_origseq; + IEEE80211_ADDR_COPY(prep.prep_targetaddr, vap->iv_myaddr); + prep.prep_targetseq = ++hs->hs_seq; prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; - IEEE80211_ADDR_COPY(prep.prep_origaddr, vap->iv_myaddr); - prep.prep_origseq = ++hs->hs_seq; + IEEE80211_ADDR_COPY(prep.prep_origaddr, preq->preq_origaddr); + prep.prep_origseq = preq->preq_origseq; hwmp_send_prep(ni, vap->iv_myaddr, wh->i_addr2, &prep); /* * Build the reverse path, if we don't have it already. @@ -784,13 +784,13 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_flags = 0; prep.prep_hopcount = 0; prep.prep_ttl = ms->ms_ttl; - IEEE80211_ADDR_COPY(prep.prep_origaddr, vap->iv_myaddr); + IEEE80211_ADDR_COPY(prep.prep_origaddr, rootmac); prep.prep_origseq = preq->preq_origseq; - prep.prep_targetseq = ++hs->hs_seq; prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; - IEEE80211_ADDR_COPY(prep.prep_targetaddr, rootmac); - prep.prep_targetseq = PREQ_TSEQ(0); + IEEE80211_ADDR_COPY(prep.prep_targetaddr, + vap->iv_myaddr); + prep.prep_targetseq = ++hs->hs_seq; hwmp_send_prep(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &prep); } @@ -848,13 +848,13 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_hopcount = rt->rt_nhops + 1; prep.prep_ttl = ms->ms_ttl; IEEE80211_ADDR_COPY(&prep.prep_targetaddr, - preq->preq_origaddr); + PREQ_TADDR(0)); prep.prep_targetseq = hrorig->hr_seq; prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = rt->rt_metric + ms->ms_pmetric->mpm_metric(ni); IEEE80211_ADDR_COPY(&prep.prep_origaddr, - PREQ_TADDR(0)); + preq->preq_origaddr); prep.prep_origseq = hrorig->hr_seq; hwmp_send_prep(ni, vap->iv_myaddr, broadcastaddr, &prep); @@ -951,19 +951,19 @@ hwmp_recv_prep(struct ieee80211vap *vap, return; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "received PREP from %s", ether_sprintf(prep->prep_origaddr)); + "received PREP from %s", ether_sprintf(prep->prep_targetaddr)); - rt = ieee80211_mesh_rt_find(vap, prep->prep_origaddr); + rt = ieee80211_mesh_rt_find(vap, prep->prep_targetaddr); if (rt == NULL) { /* * If we have no entry this could be a reply to a root PREQ. */ if (hs->hs_rootmode != IEEE80211_HWMP_ROOTMODE_DISABLED) { - rt = ieee80211_mesh_rt_add(vap, prep->prep_origaddr); + rt = ieee80211_mesh_rt_add(vap, prep->prep_targetaddr); if (rt == NULL) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "unable to add PREP path to %s", - ether_sprintf(prep->prep_origaddr)); + ether_sprintf(prep->prep_targetaddr)); vap->iv_stats.is_mesh_rtaddfailed++; return; } @@ -974,7 +974,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "add root path to %s nhops %d metric %d (PREP)", - ether_sprintf(prep->prep_origaddr), + ether_sprintf(prep->prep_targetaddr), rt->rt_nhops, rt->rt_metric); return; } @@ -984,30 +984,30 @@ hwmp_recv_prep(struct ieee80211vap *vap, * Sequence number validation. */ hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); - if (HWMP_SEQ_LEQ(prep->prep_origseq, hr->hr_seq)) { + if (HWMP_SEQ_LEQ(prep->prep_targetseq, hr->hr_seq)) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "discard PREP from %s, old seq no %u <= %u", - ether_sprintf(prep->prep_origaddr), - prep->prep_origseq, hr->hr_seq); + ether_sprintf(prep->prep_targetaddr), + prep->prep_targetseq, hr->hr_seq); return; } - hr->hr_seq = prep->prep_origseq; + hr->hr_seq = prep->prep_targetseq; /* * If it's NOT for us, propagate the PREP. */ - if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_targetaddr) && + if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_origaddr) && prep->prep_ttl > 1 && prep->prep_hopcount < hs->hs_maxhops) { struct ieee80211_meshprep_ie pprep; /* propagated PREP */ IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "propagate PREP from %s", - ether_sprintf(prep->prep_origaddr)); + ether_sprintf(prep->prep_targetaddr)); memcpy(&pprep, prep, sizeof(pprep)); pprep.prep_hopcount += 1; pprep.prep_ttl -= 1; pprep.prep_metric += ms->ms_pmetric->mpm_metric(ni); - IEEE80211_ADDR_COPY(pprep.prep_origaddr, vap->iv_myaddr); + IEEE80211_ADDR_COPY(pprep.prep_targetaddr, vap->iv_myaddr); hwmp_send_prep(ni, vap->iv_myaddr, broadcastaddr, &pprep); } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); @@ -1015,9 +1015,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, /* NB: never clobber a proxy entry */; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "discard PREP for %s, route is marked PROXY", - ether_sprintf(prep->prep_origaddr)); + ether_sprintf(prep->prep_targetaddr)); vap->iv_stats.is_hwmp_proxy++; - } else if (prep->prep_targetseq == hr->hr_targetseq) { + } else if (prep->prep_origseq == hr->hr_origseq) { /* * Check if we already have a path to this node. * If we do, check if this path reply contains a @@ -1041,14 +1041,14 @@ hwmp_recv_prep(struct ieee80211vap *vap, } else { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "ignore PREP for %s, hopcount %d:%d metric %d:%d", - ether_sprintf(prep->prep_origaddr), + ether_sprintf(prep->prep_targetaddr), rt->rt_nhops, prep->prep_hopcount, rt->rt_metric, prep->prep_metric); } } else { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "discard PREP for %s, wrong seqno %u != %u", - ether_sprintf(prep->prep_origaddr), prep->prep_targetseq, + ether_sprintf(prep->prep_targetaddr), prep->prep_origseq, hr->hr_seq); vap->iv_stats.is_hwmp_wrongseq++; } @@ -1223,7 +1223,8 @@ hwmp_recv_rann(struct ieee80211vap *vap, struct ieee80211_meshrann_ie prann; if (ni == vap->iv_bss || - ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) + ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED || + IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) return; rt = ieee80211_mesh_rt_find(vap, rann->rann_addr); @@ -1305,8 +1306,8 @@ hwmp_discover(struct ieee80211vap *vap, hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) { - if (hr->hr_targetseq == 0) - hr->hr_targetseq = ++hs->hs_seq; + if (hr->hr_origseq == 0) + hr->hr_origseq = ++hs->hs_seq; rt->rt_metric = IEEE80211_MESHLMETRIC_INITIALVAL; rt->rt_lifetime = ticks_to_msecs(ieee80211_hwmp_pathtimeout); @@ -1324,7 +1325,7 @@ hwmp_discover(struct ieee80211vap *vap, preq.preq_ttl = ms->ms_ttl; preq.preq_id = ++hs->hs_preqid; IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); - preq.preq_origseq = hr->hr_targetseq; + preq.preq_origseq = hr->hr_origseq; preq.preq_lifetime = rt->rt_lifetime; preq.preq_metric = rt->rt_metric; preq.preq_tcount = 1; From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 14:04:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C69D1065692; Mon, 19 Oct 2009 14:04:19 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592DC8FC0A; Mon, 19 Oct 2009 14:04:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JE4JSG003640; Mon, 19 Oct 2009 14:04:19 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JE4JK7003638; Mon, 19 Oct 2009 14:04:19 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200910191404.n9JE4JK7003638@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 19 Oct 2009 14:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198231 - head/sbin/dumpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 14:04:20 -0000 Author: ru Date: Mon Oct 19 14:04:19 2009 New Revision: 198231 URL: http://svn.freebsd.org/changeset/base/198231 Log: Properly re-create "-s size" argument to newfs(8). Modified: head/sbin/dumpfs/dumpfs.c Modified: head/sbin/dumpfs/dumpfs.c ============================================================================== --- head/sbin/dumpfs/dumpfs.c Mon Oct 19 11:17:46 2009 (r198230) +++ head/sbin/dumpfs/dumpfs.c Mon Oct 19 14:04:19 2009 (r198231) @@ -413,7 +413,7 @@ marshal(const char *name) break; } /* -p..r unimplemented */ - printf("-s %jd ", (intmax_t)fs->fs_size); + printf("-s %jd ", (intmax_t)fsbtodb(fs, fs->fs_size)); printf("%s ", disk.d_name); printf("\n"); From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 14:36:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B9E51065696; Mon, 19 Oct 2009 14:36:13 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEBF78FC1D; Mon, 19 Oct 2009 14:36:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JEaCrG004266; Mon, 19 Oct 2009 14:36:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JEaC2g004264; Mon, 19 Oct 2009 14:36:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910191436.n9JEaC2g004264@svn.freebsd.org> From: Christian Brueffer Date: Mon, 19 Oct 2009 14:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198232 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 14:36:13 -0000 Author: brueffer Date: Mon Oct 19 14:36:12 2009 New Revision: 198232 URL: http://svn.freebsd.org/changeset/base/198232 Log: Powercrypt and NetSec seem to be defunct (webpages point to link farms and a google search yields no alternative). Remove the links but keep the entries around for reference. PR: 139756 Submitted by: Patrick Oonk MFC after: 3 days Modified: head/share/man/man4/hifn.4 Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon Oct 19 14:04:19 2009 (r198231) +++ head/share/man/man4/hifn.4 Mon Oct 19 14:36:12 2009 (r198232) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2006 +.Dd October 19, 2009 .Dt HIFN 4 .Os .Sh NAME @@ -85,17 +85,11 @@ Came as 128KB SRAM model, or 2MB DRAM mo .It Hifn 7751 Reference board with 512KB SRAM. .It PowerCrypt -See -.Pa http://www.powercrypt.com/ . Comes with 512KB SRAM. .It XL-Crypt -See -.Pa http://www.powercrypt.com/ . Only board based on 7811 (which is faster than 7751 and has a random number generator). .It NetSec 7751 -See -.Pa http://www.netsec.net/ . Supports the most IPsec sessions, with 1MB SRAM. .It Soekris Engineering vpn1201 and vpn1211 See From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 15:19:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F0C9106568B; Mon, 19 Oct 2009 15:19:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DD6A8FC1F; Mon, 19 Oct 2009 15:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JFJEEC005093; Mon, 19 Oct 2009 15:19:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JFJEb8005091; Mon, 19 Oct 2009 15:19:14 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910191519.n9JFJEb8005091@svn.freebsd.org> From: Robert Watson Date: Mon, 19 Oct 2009 15:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198233 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 15:19:14 -0000 Author: rwatson Date: Mon Oct 19 15:19:14 2009 New Revision: 198233 URL: http://svn.freebsd.org/changeset/base/198233 Log: Clean up comments, white space, and style in pfil.c (especially new VNET bits). MFC after: 3 days (not VNET bits) Modified: head/sys/net/pfil.c Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Mon Oct 19 14:36:12 2009 (r198232) +++ head/sys/net/pfil.c Mon Oct 19 15:19:14 2009 (r198233) @@ -86,14 +86,13 @@ pfil_run_hooks(struct pfil_head *ph, str } } PFIL_RUNLOCK(ph, &rmpt); - *mp = m; return (rv); } /* - * pfil_head_register() registers a pfil_head with the packet filter - * hook mechanism. + * pfil_head_register() registers a pfil_head with the packet filter hook + * mechanism. */ int pfil_head_register(struct pfil_head *ph) @@ -105,7 +104,7 @@ pfil_head_register(struct pfil_head *ph) if (ph->ph_type == lph->ph_type && ph->ph_un.phu_val == lph->ph_un.phu_val) { PFIL_LIST_UNLOCK(); - return EEXIST; + return (EEXIST); } } PFIL_LOCK_INIT(ph); @@ -151,7 +150,6 @@ pfil_head_get(int type, u_long val) if (ph->ph_type == type && ph->ph_un.phu_val == val) break; PFIL_LIST_UNLOCK(); - return (ph); } @@ -208,7 +206,7 @@ pfil_add_hook(int (*func)(void *, struct ph->ph_nhooks++; } PFIL_WUNLOCK(ph); - return 0; + return (0); locked_error: PFIL_WUNLOCK(ph); error: @@ -216,12 +214,12 @@ error: free(pfh1, M_IFADDR); if (pfh2 != NULL) free(pfh2, M_IFADDR); - return err; + return (err); } /* - * pfil_remove_hook removes a specific function from the packet filter - * hook list. + * pfil_remove_hook removes a specific function from the packet filter hook + * list. */ int pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int, @@ -230,7 +228,6 @@ pfil_remove_hook(int (*func)(void *, str int err = 0; PFIL_WLOCK(ph); - if (flags & PFIL_IN) { err = pfil_list_remove(&ph->ph_in, func, arg); if (err == 0) @@ -242,8 +239,7 @@ pfil_remove_hook(int (*func)(void *, str ph->ph_nhooks--; } PFIL_WUNLOCK(ph); - - return err; + return (err); } static int @@ -257,17 +253,17 @@ pfil_list_add(pfil_list_t *list, struct TAILQ_FOREACH(pfh, list, pfil_link) if (pfh->pfil_func == pfh1->pfil_func && pfh->pfil_arg == pfh1->pfil_arg) - return EEXIST; + return (EEXIST); + /* - * insert the input list in reverse order of the output list - * so that the same path is followed in or out of the kernel. + * Insert the input list in reverse order of the output list so that + * the same path is followed in or out of the kernel. */ if (flags & PFIL_IN) TAILQ_INSERT_HEAD(list, pfh1, pfil_link); else TAILQ_INSERT_TAIL(list, pfh1, pfil_link); - - return 0; + return (0); } /* @@ -285,30 +281,32 @@ pfil_list_remove(pfil_list_t *list, if (pfh->pfil_func == func && pfh->pfil_arg == arg) { TAILQ_REMOVE(list, pfh, pfil_link); free(pfh, M_IFADDR); - return 0; + return (0); } - return ENOENT; + return (ENOENT); } -/**************** - * Stuff that must be initialized for every instance - * (including the first of course). +/* + * Stuff that must be initialized for every instance (including the first of + * course). */ static int vnet_pfil_init(const void *unused) { + LIST_INIT(&V_pfil_head_list); return (0); } -/*********************** +/* * Called for the removal of each instance. */ static int vnet_pfil_uninit(const void *unused) { + /* XXX should panic if list is not empty */ - return 0; + return (0); } /* Define startup order. */ @@ -317,17 +315,17 @@ vnet_pfil_uninit(const void *unused) #define PFIL_VNET_ORDER (PFIL_MODEVENT_ORDER + 2) /* Later still. */ /* - * Starting up. + * Starting up. + * * VNET_SYSINIT is called for each existing vnet and each new vnet. */ VNET_SYSINIT(vnet_pfil_init, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, - vnet_pfil_init, NULL); + vnet_pfil_init, NULL); /* - * Closing up shop. These are done in REVERSE ORDER, - * Not called on reboot. + * Closing up shop. These are done in REVERSE ORDER. Not called on reboot. + * * VNET_SYSUNINIT is called for each exiting vnet as it exits. */ VNET_SYSUNINIT(vnet_pfil_uninit, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, - vnet_pfil_uninit, NULL); - + vnet_pfil_uninit, NULL); From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 15:50:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA03B106566C; Mon, 19 Oct 2009 15:50:59 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7E198FC0A; Mon, 19 Oct 2009 15:50:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JFoxNv005744; Mon, 19 Oct 2009 15:50:59 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JFoxdJ005742; Mon, 19 Oct 2009 15:50:59 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200910191550.n9JFoxdJ005742@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 19 Oct 2009 15:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198235 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 15:51:00 -0000 Author: ru Date: Mon Oct 19 15:50:59 2009 New Revision: 198235 URL: http://svn.freebsd.org/changeset/base/198235 Log: Clean up markup (mainly). Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Oct 19 15:25:53 2009 (r198234) +++ head/sbin/geom/class/part/gpart.8 Mon Oct 19 15:50:59 2009 (r198235) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 18, 2008 +.Dd November 18, 2008 .Dt GPART 8 .Os .Sh NAME @@ -43,20 +43,34 @@ lines in your kernel configuration file: .Cd "options GEOM_PART_VTOC8" .Ed .Pp -The GEOM_PART_APM option adds support for the Apple Partition Map (APM) +The +.Dv GEOM_PART_APM +option adds support for the Apple Partition Map (APM) found on Apple Macintosh computers. -The GEOM_PART_BSD option adds support for the traditional BSD disklabel. -The GEOM_PART_GPT option adds support for the GUID Partition Table (GPT) +The +.Dv GEOM_PART_BSD +option adds support for the traditional +.Bx +disklabel. +The +.Dv GEOM_PART_GPT +option adds support for the GUID Partition Table (GPT) found on Intel Itanium computers and Intel-based Macintosh computers. -The GEOM_PART_MBR option adds support for the Master Boot Record (MBR) +The +.Dv GEOM_PART_MBR +option adds support for the Master Boot Record (MBR) found on PCs and used on many removable media. -The GEOM_PART_PC98 option adds support for the MBR variant as used on +The +.Dv GEOM_PART_PC98 +option adds support for the MBR variant as used on NEC PC-98 computers. -The GEOM_PART_VTOC8 option adds support for Sun's SMI VTOC8 label as +The +.Dv GEOM_PART_VTOC8 +option adds support for Sun's SMI VTOC8 label as found on UltraSPARC-based computers. .Pp Usage of the -.Xr gpart 8 +.Ns Nm utility: .Pp .\" ==== ADD ==== @@ -123,7 +137,7 @@ utility: .Ar geom .\" ==== UNSET ==== .Nm -.Cm unset +.Cm unset .Fl a Ar attrib .Fl i Ar index .Op Fl f Ar flags @@ -134,7 +148,7 @@ The .Nm utility is used to partition GEOM providers, normally disks. The first argument of which is the action to be taken: -.Bl -tag -width ".Cm wwwwwww" +.Bl -tag -width ".Cm bootcode" .\" ==== ADD ==== .It Cm add Add a new partition to the partitioning scheme given by @@ -148,13 +162,15 @@ option. The type of the partition is given by the .Fl t Ar type option. -Partition types are discussed in the section entitled "Partition Types". +Partition types are discussed below in the section entitled +.Sx "PARTITION TYPES" . .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl i Ar index The index in the partition table at which the new partition is to be -placed. The index determines the name of the device special file used +placed. +The index determines the name of the device special file used to represent the partition. .It Fl l Ar label The label attached to the partition. @@ -162,7 +178,9 @@ This option is only valid when used on p partition labels. .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== BOOTCODE ==== @@ -185,7 +203,7 @@ The option specifies a file that contains the bootstrap code. The contents and size of the file are determined by the partitioning scheme. -For the MBR scheme, it's a 512 byte file of which the first 446 bytes +For the MBR scheme, it is a 512 byte file of which the first 446 bytes are installed as bootstrap code. The .Fl p Ar partcode @@ -196,11 +214,13 @@ The partition is specified by the option. The size of the file must be smaller than the size of the partition. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== COMMIT ==== @@ -229,8 +249,8 @@ option determines the scheme to use. The kernel needs to have support for a particular scheme before that scheme can be used to partition a disk. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl n Ar entries The number of entries in the partition table. Every partitioning scheme has a minimum and a maximum number of entries @@ -242,7 +262,9 @@ By default, partition tables are created entries. .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== DELETE ==== @@ -254,11 +276,13 @@ and further identified by the option. The partition cannot be actively used by the kernel. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== DESTROY ==== @@ -266,11 +290,13 @@ about its use. Destroy the partitioning scheme as implemented by geom .Ar geom . .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== MODIFY ==== @@ -290,22 +316,26 @@ option. Not all partitioning schemes support labels and it is invalid to try to change a partition label in such cases. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== SET ==== .It Cm set Set the named attribute on the partition entry. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== SHOW ==== @@ -314,7 +344,8 @@ Show the current partition information o or all geoms if none are specified. .\" ==== UNDO ==== .It Cm undo -Revert any pending changes. +Revert any pending changes for geom +.Ar geom . This action is the opposite of the .Cm commit action and can be used to undo any changes that have not been committed. @@ -322,11 +353,13 @@ action and can be used to undo any chang .It Cm unset Clear the named attribute on the partition entry. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .El @@ -338,47 +371,82 @@ utility uses symbolic names for common p user needs to know what the partitioning scheme in question is and what the actual number or identification needs to be used for a particular type. -the +The .Nm utility also allows the user to specify scheme-specific partition types -for partition types that don't have symbol names. +for partition types that do not have symbol names. The symbolic names currently understood are: -.Bl -tag -width "wwwwwwwwwwwww" -.It efi +.Bl -tag -width ".Cm freebsd-vinum" +.It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). In such cases, the GPT partitioning scheme is being used and the actual partition type for the system partition can also be specified as -"!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab". -.It freebsd -A FreeBSD partition that uses the BSD disklabel to sub-divide the +.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . +.It Cm freebsd +A +.Fx +partition that uses the +.Bx +disklabel to sub-divide the partition into file systems. This is a legacy partition type and should not be used for the APM or GPT schemes. -The scheme-specific types are "!165" for MBR, "!FreeBSD" for APM, and -"!516e7cb4-6ecf-11d6-8ff8-00022d09712b" for GPT. -.It freebsd-boot -A FreeBSD partition dedicated to bootstrap code. -The scheme-specific type is "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" for GPT. -.It freebsd-swap -A FreeBSD partition dedicated to swap space. -The scheme-specific types are "!FreeBSD-swap" for APM, and -"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT. -.It freebsd-ufs -A FreeBSD partition that contains a UFS or UFS2 file system. -the scheme-specific types are "!FreeBSD-UFS" for APM, and -"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT. -.It freebsd-vinum -A FreeBSD partition that contains a Vinum volume. -The scheme-specific types are "!FreeBSD-Vinum" for APM, and -"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT. -.It freebsd-zfs -A FreeBSD partition that contains a ZFS volume. -The scheme-specific types are "!FreeBSD-ZFS" for APM, and -"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT. -.It mbr +The scheme-specific types are +.Qq Li "!165" +for MBR, +.Qq Li "!FreeBSD" +for APM, and +.Qq Li "!516e7cb4-6ecf-11d6-8ff8-00022d09712b" +for GPT. +.It Cm freebsd-boot +A +.Fx +partition dedicated to bootstrap code. +The scheme-specific type is +.Qq Li "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" +for GPT. +.It Cm freebsd-swap +A +.Fx +partition dedicated to swap space. +The scheme-specific types are +.Qq Li "!FreeBSD-swap" +for APM, and +.Qq Li "!516e7cb5-6ecf-11d6-8ff8-00022d09712b" +for GPT. +.It Cm freebsd-ufs +A +.Fx +partition that contains a UFS or UFS2 file system. +The scheme-specific types are +.Qq Li "!FreeBSD-UFS" +for APM, and +.Qq Li "!516e7cb6-6ecf-11d6-8ff8-00022d09712b" +for GPT. +.It Cm freebsd-vinum +A +.Fx +partition that contains a Vinum volume. +The scheme-specific types are +.Qq Li "!FreeBSD-Vinum" +for APM, and +.Qq Li "!516e7cb8-6ecf-11d6-8ff8-00022d09712b" +for GPT. +.It Cm freebsd-zfs +A +.Fx +partition that contains a ZFS volume. +The scheme-specific types are +.Qq Li "!FreeBSD-ZFS" +for APM, and +.Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" +for GPT. +.It Cm mbr A partition that is sub-partitioned by a master boot record (MBR). -This type is known as "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. +This type is known as +.Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" +by GPT. .El .Sh OPERATIONAL FLAGS Actions other than the @@ -391,10 +459,12 @@ option. This option is used to specify action-specific operational flags. By default, the .Nm -utility defines the 'C' flag so that the action is immediately +utility defines the +.Ql C +flag so that the action is immediately committed. The user can specify -.Fl f Ar x +.Dq Fl f Cm x to have the action result in a pending change that can later, with other pending changes, be committed as a single compound change with the @@ -417,31 +487,33 @@ Embed GPT bootstrap code into protective .Ed .Pp Create a dedicated -.Pa freebsd-boot -partition that can boot FreeBSD from a -.Pa freebsd-ufs +.Cm freebsd-boot +partition that can boot +.Fx +from a +.Cm freebsd-ufs partition, and install bootstrap code into it. This partition must be larger than .Pa /boot/gptboot , or the GPT boot you are planning to write. A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but lets use 128 blocks (64 KB) here in +booting from UFS but let's use 128 blocks (64 KB) here in this example, in order to reserve some space for potential -future need (e.g. from a ZFS partition). +future need (e.g.\& from a ZFS partition). .Bd -literal -offset indent /sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 .Ed .Pp Create a 512MB-sized -.Pa freebsd-ufs +.Cm freebsd-ufs partition that would contain UFS where the system boot from. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed .Sh SEE ALSO .Xr geom 4 , -.Xr geom 8 , +.Xr geom 8 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 16:00:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4048C106566C; Mon, 19 Oct 2009 16:00:25 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9888FC18; Mon, 19 Oct 2009 16:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JG0Piq006022; Mon, 19 Oct 2009 16:00:25 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JG0O6b005970; Mon, 19 Oct 2009 16:00:24 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200910191600.n9JG0O6b005970@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 19 Oct 2009 16:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198236 - in head/sbin: . adjkerntz atacontrol atm/atmconfig badsect bsdlabel camcontrol ccdconfig clri comcontrol conscontrol dhclient dmesg dump dumpfs dumpon geom ggate growfs gvinum... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 16:00:25 -0000 Author: ru Date: Mon Oct 19 16:00:24 2009 New Revision: 198236 URL: http://svn.freebsd.org/changeset/base/198236 Log: Switch the default WARNS level for sbin/ to 6. Submitted by: Ulrich Spörlein Modified: head/sbin/Makefile.inc head/sbin/adjkerntz/Makefile head/sbin/atacontrol/Makefile head/sbin/atm/atmconfig/Makefile head/sbin/badsect/Makefile head/sbin/bsdlabel/Makefile head/sbin/camcontrol/Makefile head/sbin/ccdconfig/Makefile head/sbin/clri/Makefile head/sbin/comcontrol/Makefile head/sbin/conscontrol/Makefile head/sbin/dhclient/Makefile head/sbin/dmesg/Makefile head/sbin/dump/Makefile head/sbin/dumpfs/Makefile head/sbin/dumpon/Makefile head/sbin/geom/Makefile head/sbin/geom/Makefile.inc head/sbin/ggate/Makefile.inc head/sbin/growfs/Makefile head/sbin/gvinum/Makefile head/sbin/init/Makefile head/sbin/ipf/Makefile.inc head/sbin/iscontrol/Makefile head/sbin/kldunload/Makefile head/sbin/ldconfig/Makefile head/sbin/md5/Makefile head/sbin/mdconfig/Makefile head/sbin/mdmfs/Makefile head/sbin/mksnap_ffs/Makefile head/sbin/mount/Makefile head/sbin/mount_autofs/Makefile head/sbin/mount_cd9660/Makefile head/sbin/mount_ext2fs/Makefile head/sbin/mount_msdosfs/Makefile head/sbin/mount_nullfs/Makefile head/sbin/mount_reiserfs/Makefile head/sbin/mount_unionfs/Makefile head/sbin/newfs_msdos/Makefile head/sbin/nfsiod/Makefile head/sbin/pfctl/Makefile head/sbin/rcorder/Makefile head/sbin/reboot/Makefile head/sbin/recoverdisk/Makefile head/sbin/routed/Makefile head/sbin/savecore/Makefile head/sbin/sconfig/Makefile head/sbin/shutdown/Makefile head/sbin/spppcontrol/Makefile head/sbin/swapon/Makefile head/sbin/tunefs/Makefile Modified: head/sbin/Makefile.inc ============================================================================== --- head/sbin/Makefile.inc Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/Makefile.inc Mon Oct 19 16:00:24 2009 (r198236) @@ -4,7 +4,7 @@ .include BINDIR?= /sbin -WARNS?= 2 +WARNS?= 6 .if ${MK_DYNAMICROOT} == "no" NO_SHARED?= YES Modified: head/sbin/adjkerntz/Makefile ============================================================================== --- head/sbin/adjkerntz/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/adjkerntz/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -2,5 +2,6 @@ PROG= adjkerntz MAN= adjkerntz.8 +WARNS?= 2 .include Modified: head/sbin/atacontrol/Makefile ============================================================================== --- head/sbin/atacontrol/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/atacontrol/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -2,6 +2,5 @@ PROG= atacontrol MAN= atacontrol.8 -WARNS?= 6 .include Modified: head/sbin/atm/atmconfig/Makefile ============================================================================== --- head/sbin/atm/atmconfig/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/atm/atmconfig/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -29,8 +29,6 @@ CLEANFILES+= oid.h .if ${MACHINE_ARCH} == "arm" WARNS?= 3 -.else -WARNS?= 6 .endif FILES= atmconfig.help atmconfig_device.help Modified: head/sbin/badsect/Makefile ============================================================================== --- head/sbin/badsect/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/badsect/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -5,5 +5,6 @@ PROG= badsect DPADD= ${LIBUFS} LDADD= -lufs MAN= badsect.8 +WARNS?= 2 .include Modified: head/sbin/bsdlabel/Makefile ============================================================================== --- head/sbin/bsdlabel/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/bsdlabel/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -13,6 +13,7 @@ LINKS= ${BINDIR}/bsdlabel ${BINDIR}/disk MLINKS= bsdlabel.8 disklabel.8 .endif +WARNS?= 2 DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} LDADD= -lgeom -lbsdxml -lsbuf Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/camcontrol/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -9,8 +9,6 @@ CFLAGS+= -DMINIMALISTIC .endif .if ${MACHINE_ARCH} == "arm" WARNS?= 3 -.else -WARNS?= 6 .endif DPADD= ${LIBCAM} ${LIBSBUF} ${LIBUTIL} LDADD= -lcam -lsbuf -lutil Modified: head/sbin/ccdconfig/Makefile ============================================================================== --- head/sbin/ccdconfig/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/ccdconfig/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= ccdconfig -WARNS?= 6 MAN= ccdconfig.8 DPADD= ${LIBGEOM} Modified: head/sbin/clri/Makefile ============================================================================== --- head/sbin/clri/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/clri/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -3,5 +3,6 @@ PROG= clri MAN= clri.8 +WARNS?= 2 .include Modified: head/sbin/comcontrol/Makefile ============================================================================== --- head/sbin/comcontrol/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/comcontrol/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -3,6 +3,5 @@ PROG= comcontrol MAN= comcontrol.8 -WARNS?= 6 .include Modified: head/sbin/conscontrol/Makefile ============================================================================== --- head/sbin/conscontrol/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/conscontrol/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -2,5 +2,6 @@ PROG= conscontrol MAN= conscontrol.8 +WARNS?= 2 .include Modified: head/sbin/dhclient/Makefile ============================================================================== --- head/sbin/dhclient/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/dhclient/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -40,4 +40,6 @@ SCRIPTS=dhclient-script MAN= dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp-options.5 \ dhclient-script.8 +WARNS?= 2 + .include Modified: head/sbin/dmesg/Makefile ============================================================================== --- head/sbin/dmesg/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/dmesg/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -4,8 +4,6 @@ PROG= dmesg MAN= dmesg.8 -WARNS?= 6 - LDADD= -lkvm DPADD= ${LIBKVM} Modified: head/sbin/dump/Makefile ============================================================================== --- head/sbin/dump/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/dump/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -19,5 +19,6 @@ CFLAGS+=-DRDUMP SRCS= itime.c main.c optr.c dumprmt.c tape.c traverse.c unctime.c cache.c MAN= dump.8 MLINKS= dump.8 rdump.8 +WARNS?= 2 .include Modified: head/sbin/dumpfs/Makefile ============================================================================== --- head/sbin/dumpfs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/dumpfs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -2,6 +2,7 @@ # $FreeBSD$ PROG= dumpfs +WARNS?= 2 DPADD= ${LIBUFS} LDADD= -lufs MAN= dumpfs.8 Modified: head/sbin/dumpon/Makefile ============================================================================== --- head/sbin/dumpon/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/dumpon/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= dumpon -WARNS?= 6 MAN= dumpon.8 .include Modified: head/sbin/geom/Makefile ============================================================================== --- head/sbin/geom/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/geom/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -11,6 +11,7 @@ PROG= geom SRCS= geom.c geom_label.c geom_part.c subr.c NO_MAN= +WARNS?= 2 CFLAGS+=-I${.CURDIR} -I${.CURDIR}/core -DSTATIC_GEOM_CLASSES DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL} Modified: head/sbin/geom/Makefile.inc ============================================================================== --- head/sbin/geom/Makefile.inc Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/geom/Makefile.inc Mon Oct 19 16:00:24 2009 (r198236) @@ -1,6 +1,5 @@ # $FreeBSD$ -WARNS?= 6 CLASS_DIR?=/lib/geom .include "../Makefile.inc" Modified: head/sbin/ggate/Makefile.inc ============================================================================== --- head/sbin/ggate/Makefile.inc Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/ggate/Makefile.inc Mon Oct 19 16:00:24 2009 (r198236) @@ -1,5 +1,3 @@ # $FreeBSD$ -WARNS?= 6 - .include "../Makefile.inc" Modified: head/sbin/growfs/Makefile ============================================================================== --- head/sbin/growfs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/growfs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -10,8 +10,6 @@ PROG= growfs SRCS= growfs.c MAN= growfs.8 -WARNS?= 6 - .if defined(GFSDBG) SRCS+= debug.c .endif Modified: head/sbin/gvinum/Makefile ============================================================================== --- head/sbin/gvinum/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/gvinum/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -4,6 +4,7 @@ PROG= gvinum SRCS= gvinum.c gvinum.h geom_vinum_share.c MAN= gvinum.8 +WARNS?= 2 CFLAGS+= -I${.CURDIR}/../../sys DPADD= ${LIBREADLINE} ${LIBTERMCAP} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM} Modified: head/sbin/init/Makefile ============================================================================== --- head/sbin/init/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/init/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -5,7 +5,6 @@ PROG= init MAN= init.8 PRECIOUSPROG= INSTALLFLAGS=-b -B.bak -WARNS?= 6 CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT DPADD= ${LIBUTIL} ${LIBCRYPT} LDADD= -lutil -lcrypt Modified: head/sbin/ipf/Makefile.inc ============================================================================== --- head/sbin/ipf/Makefile.inc Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/ipf/Makefile.inc Mon Oct 19 16:00:24 2009 (r198236) @@ -1,5 +1,7 @@ # $FreeBSD$ +WARNS?= 2 + CFLAGS+= -I${.CURDIR}/../../../contrib/ipfilter CFLAGS+= -I${.CURDIR}/../../../contrib/ipfilter/tools CFLAGS+= -I${.CURDIR}/../../../sys Modified: head/sbin/iscontrol/Makefile ============================================================================== --- head/sbin/iscontrol/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/iscontrol/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -5,6 +5,7 @@ PROG= iscontrol DPADD= ${LIBCAM} ${LIBMD} LDADD= -lcam -lmd +WARNS?= 2 CFLAGS += -I${.CURDIR}/../../sys/dev/iscsi/initiator #CFLAGS += -g -DDEBUG Modified: head/sbin/kldunload/Makefile ============================================================================== --- head/sbin/kldunload/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/kldunload/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -28,6 +28,5 @@ PROG= kldunload MAN= kldunload.8 -WARNS?= 6 .include Modified: head/sbin/ldconfig/Makefile ============================================================================== --- head/sbin/ldconfig/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/ldconfig/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -3,7 +3,6 @@ PROG= ldconfig SRCS= elfhints.c ldconfig.c shlib.c support.c LDDIR?= ${.CURDIR}/../../libexec/rtld-aout -WARNS?= 6 CFLAGS+=-I${LDDIR} -DFREEBSD_AOUT MAN= ldconfig.8 Modified: head/sbin/md5/Makefile ============================================================================== --- head/sbin/md5/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/md5/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -11,7 +11,6 @@ MLINKS= md5.1 rmd160.1 \ md5.1 sha1.1 \ md5.1 sha256.1 -WARNS?= 6 WFORMAT?= 1 DPADD= ${LIBMD} Modified: head/sbin/mdconfig/Makefile ============================================================================== --- head/sbin/mdconfig/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mdconfig/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -4,6 +4,7 @@ PROG= mdconfig MAN= mdconfig.8 MLINKS= mdconfig.8 vnconfig.8 +WARNS?= 2 DPADD= ${LIBUTIL} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} LDADD= -lutil -lgeom -lbsdxml -lsbuf Modified: head/sbin/mdmfs/Makefile ============================================================================== --- head/sbin/mdmfs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mdmfs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -4,6 +4,5 @@ PROG= mdmfs LINKS= ${BINDIR}/${PROG} ${BINDIR}/mount_mfs MAN= mdmfs.8 MLINKS+= mdmfs.8 mount_mfs.8 -WARNS?= 6 .include Modified: head/sbin/mksnap_ffs/Makefile ============================================================================== --- head/sbin/mksnap_ffs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mksnap_ffs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -6,6 +6,7 @@ PROG= mksnap_ffs SRCS= mksnap_ffs.c getmntopts.c MAN= mksnap_ffs.8 +WARNS?= 2 CFLAGS+=-I${.CURDIR}/../mount .if defined(NOSUID) Modified: head/sbin/mount/Makefile ============================================================================== --- head/sbin/mount/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mount/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -3,7 +3,6 @@ PROG= mount SRCS= mount.c mount_fs.c getmntopts.c vfslist.c -WARNS?= 6 MAN= mount.8 # We do NOT install the getmntopts.3 man page. Modified: head/sbin/mount_autofs/Makefile ============================================================================== --- head/sbin/mount_autofs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mount_autofs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -4,5 +4,6 @@ PROG=mount_autofs MAN=mount_autofs.8 BINDIR?=/sbin +WARNS?= 2 .include Modified: head/sbin/mount_cd9660/Makefile ============================================================================== --- head/sbin/mount_cd9660/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mount_cd9660/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -9,7 +9,6 @@ LDADD= -lkiconv MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} -WARNS?= 6 # Needs to be dynamically linked for optional dlopen() access to # userland libiconv Modified: head/sbin/mount_ext2fs/Makefile ============================================================================== --- head/sbin/mount_ext2fs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mount_ext2fs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -5,6 +5,7 @@ PROG= mount_ext2fs SRCS= mount_ext2fs.c getmntopts.c MAN= mount_ext2fs.8 +WARNS?= 2 MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} Modified: head/sbin/mount_msdosfs/Makefile ============================================================================== --- head/sbin/mount_msdosfs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mount_msdosfs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -10,7 +10,6 @@ LDADD= -lkiconv MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} -WARNS?= 6 # Needs to be dynamically linked for optional dlopen() access to # userland libiconv Modified: head/sbin/mount_nullfs/Makefile ============================================================================== --- head/sbin/mount_nullfs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mount_nullfs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -7,7 +7,6 @@ MAN= mount_nullfs.8 MOUNT= ${.CURDIR}/../mount CFLAGS+=-I${MOUNT} -WARNS?= 6 .PATH: ${MOUNT} Modified: head/sbin/mount_reiserfs/Makefile ============================================================================== --- head/sbin/mount_reiserfs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mount_reiserfs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -7,7 +7,6 @@ MAN = mount_reiserfs.8 # mount_reiserfs needs mntopts.h and getmntopts.c from src/sbin/mount/ MOUNT ?= ${.CURDIR}/../mount CFLAGS += -I${MOUNT} -WARNS ?= 6 .PATH: ${MOUNT} Modified: head/sbin/mount_unionfs/Makefile ============================================================================== --- head/sbin/mount_unionfs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/mount_unionfs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -7,7 +7,6 @@ MAN= mount_unionfs.8 MOUNT= ${.CURDIR}/../mount CFLAGS+=-I${MOUNT} -WARNS?= 6 .PATH: ${MOUNT} Modified: head/sbin/newfs_msdos/Makefile ============================================================================== --- head/sbin/newfs_msdos/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/newfs_msdos/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -5,8 +5,6 @@ MAN= newfs_msdos.8 .if ${MACHINE_ARCH} == "arm" WARNS?= 3 -.else -WARNS?= 6 .endif .include Modified: head/sbin/nfsiod/Makefile ============================================================================== --- head/sbin/nfsiod/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/nfsiod/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -2,7 +2,6 @@ # $FreeBSD$ PROG= nfsiod -WARNS?= 6 MAN= nfsiod.8 .include Modified: head/sbin/pfctl/Makefile ============================================================================== --- head/sbin/pfctl/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/pfctl/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -12,6 +12,7 @@ SRCS+= pfctl_osfp.c pfctl_radix.c pfctl_ SRCS+= pfctl_optimize.c SRCS+= pf_ruleset.c +WARNS?= 2 CFLAGS+= -Wall -Wmissing-prototypes -Wno-uninitialized CFLAGS+= -Wstrict-prototypes -I${.CURDIR}/../../contrib/pf/pfctl Modified: head/sbin/rcorder/Makefile ============================================================================== --- head/sbin/rcorder/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/rcorder/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -8,7 +8,6 @@ MAN= rcorder.8 LDADD= -lutil DPADD= ${LIBUTIL} -WARNS?= 6 # XXX hack for make's hash.[ch] CFLAGS+= -DORDER -I. Modified: head/sbin/reboot/Makefile ============================================================================== --- head/sbin/reboot/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/reboot/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -2,7 +2,6 @@ # $FreeBSD$ PROG= reboot -WARNS?= 6 DPADD= ${LIBUTIL} LDADD= -lutil MAN= reboot.8 nextboot.8 Modified: head/sbin/recoverdisk/Makefile ============================================================================== --- head/sbin/recoverdisk/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/recoverdisk/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= recoverdisk -WARNS?= 6 .include Modified: head/sbin/routed/Makefile ============================================================================== --- head/sbin/routed/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/routed/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -7,9 +7,7 @@ MAN= routed.8 SUBDIR= rtquery LDADD= -lmd DPADD= ${LIBMD} -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" -WARNS?= 6 -.else +.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "amd64" WARNS?= 0 .endif Modified: head/sbin/savecore/Makefile ============================================================================== --- head/sbin/savecore/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/savecore/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= savecore -WARNS?= 6 DPADD= ${LIBZ} LDADD= -lz MAN= savecore.8 Modified: head/sbin/sconfig/Makefile ============================================================================== --- head/sbin/sconfig/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/sconfig/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -4,5 +4,6 @@ PROG= sconfig MAN= sconfig.8 MANSUBDIR= /i386 +WARNS?= 2 .include Modified: head/sbin/shutdown/Makefile ============================================================================== --- head/sbin/shutdown/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/shutdown/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -4,8 +4,6 @@ PROG= shutdown MAN= shutdown.8 -WARNS?= 6 - BINOWN= root BINGRP= operator BINMODE=4550 Modified: head/sbin/spppcontrol/Makefile ============================================================================== --- head/sbin/spppcontrol/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/spppcontrol/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -2,5 +2,6 @@ PROG= spppcontrol MAN= spppcontrol.8 +WARNS?= 2 .include Modified: head/sbin/swapon/Makefile ============================================================================== --- head/sbin/swapon/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/swapon/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -8,6 +8,7 @@ LINKS+= ${BINDIR}/swapon ${BINDIR}/swapc MLINKS= swapon.8 swapoff.8 MLINKS+=swapon.8 swapctl.8 +WARNS?= 2 DPADD= ${LIBUTIL} LDADD= -lutil Modified: head/sbin/tunefs/Makefile ============================================================================== --- head/sbin/tunefs/Makefile Mon Oct 19 15:50:59 2009 (r198235) +++ head/sbin/tunefs/Makefile Mon Oct 19 16:00:24 2009 (r198236) @@ -5,5 +5,6 @@ PROG= tunefs DPADD= ${LIBUFS} LDADD= -lufs MAN= tunefs.8 +WARNS?= 2 .include From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 16:12:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8652C106566C; Mon, 19 Oct 2009 16:12:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 718228FC16; Mon, 19 Oct 2009 16:12:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JGCwO8006291; Mon, 19 Oct 2009 16:12:58 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JGCwjK006277; Mon, 19 Oct 2009 16:12:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200910191612.n9JGCwjK006277@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Oct 2009 16:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198237 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/disassembler sys/contrib/d... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 16:12:58 -0000 Author: jkim Date: Mon Oct 19 16:12:58 2009 New Revision: 198237 URL: http://svn.freebsd.org/changeset/base/198237 Log: Merge ACPICA 20091013. Added: head/sys/contrib/dev/acpica/common/dmextern.c - copied, changed from r198235, vendor-sys/acpica/dist/common/dmextern.c Modified: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/debugger/dbcmds.c head/sys/contrib/dev/acpica/debugger/dbinput.c head/sys/contrib/dev/acpica/disassembler/dmutils.c head/sys/contrib/dev/acpica/disassembler/dmwalk.c head/sys/contrib/dev/acpica/dispatcher/dswload.c head/sys/contrib/dev/acpica/events/evregion.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/namespace/nsrepair.c head/sys/contrib/dev/acpica/utilities/utglobal.c head/usr.sbin/acpi/iasl/Makefile Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/changes.txt Mon Oct 19 16:12:58 2009 (r198237) @@ -1,10 +1,69 @@ ---------------------------------------- -03 September 2009. Summary of changes for version 20090903: +13 October 2009. Summary of changes for version 20091013: This release is available at www.acpica.org/downloads 1) ACPI CA Core Subsystem: +Fixed a problem where an Operation Region _REG method could be executed more +than once. If a custom address space handler is installed by the host before +the "initialize operation regions" phase of the ACPICA initialization, any +_REG methods for that address space could be executed twice. This change +fixes the problem. ACPICA BZ 427. Lin Ming. + +Fixed a possible memory leak for the Scope() ASL operator. When the exact +invocation of "Scope(\)" is executed (change scope to root), one internal +operand object was leaked. Lin Ming. + +Implemented a run-time repair for the _MAT predefined method. If the _MAT +return value is defined as a Field object in the AML, and the field +size is less than or equal to the default width of an integer (32 or 64),_MAT +can incorrectly return an Integer instead of a Buffer. ACPICA now +automatically repairs this problem. ACPICA BZ 810. + +Implemented a run-time repair for the _BIF and _BIX predefined methods. The +"OEM Information" field is often incorrectly returned as an Integer with +value zero if the field is not supported by the platform. This is due to an +ambiguity in the ACPI specification. The field should always be a string. +ACPICA now automatically repairs this problem by returning a NULL string +within the returned Package. ACPICA BZ 807. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 85.6K Code, 18.0K Data, 103.6K Total + Debug Version: 161.7K Code, 50.9K Data, 212.6K Total + Current Release: + Non-Debug Version: 85.8K Code, 18.0K Data, 103.8K Total + Debug Version: 161.8K Code, 50.6K Data, 212.4K Total + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem where references to external symbols that +contained one or more parent-prefixes (carats) were not handled correctly, +possibly causing a fault. ACPICA BZ 806. Lin Ming. + +Disassembler: Restructured the code so that all functions that handle +external symbols are in a single module. One new file is added, +common/dmextern.c. + +AML Debugger: Added a max count argument for the Batch command (which +executes multiple predefined methods within the namespace.) + +iASL: Updated the compiler documentation (User Reference.) Available at +http://www.acpica.org/documentation/. ACPICA BZ 750. + +AcpiXtract: Updated for Lint and other formatting changes. Close all open +files. + +---------------------------------------- +03 September 2009. Summary of changes for version 20090903: + +1) ACPI CA Core Subsystem: + For Windows Vista compatibility, added the automatic execution of an _INI method located at the namespace root (\_INI). This method is executed at table load time. This support is in addition to the automatic execution of @@ -74,8 +133,6 @@ subtables. ---------------------------------------- 30 July 2009. Summary of changes for version 20090730: -This release is available at www.acpica.org/downloads - The ACPI 4.0 implementation for ACPICA is complete with this release. 1) ACPI CA Core Subsystem: @@ -146,8 +203,6 @@ changes to existing tables. ACPICA BZ 77 ---------------------------------------- 25 June 2009. Summary of changes for version 20090625: -This release is available at www.acpica.org/downloads - The ACPI 4.0 Specification was released on June 16 and is available at www.acpi.info. ACPICA implementation of ACPI 4.0 is underway and will continue for the next few releases. @@ -224,8 +279,6 @@ predefined names and control methods (31 ---------------------------------------- 21 May 2009. Summary of changes for version 20090521: -This release is available at www.acpica.org/downloads - 1) ACPI CA Core Subsystem: Disabled the preservation of the SCI enable bit in the PM1 control register. @@ -297,8 +350,6 @@ after an invalid sub-table ID. ---------------------------------------- 22 April 2009. Summary of changes for version 20090422: -This release is available at www.acpica.org/downloads - 1) ACPI CA Core Subsystem: Fixed a compatibility issue with the recently released I/O port protection Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/adfile.c Mon Oct 19 16:12:58 2009 (r198237) @@ -119,7 +119,6 @@ #include #include -#include #define _COMPONENT ACPI_TOOLS @@ -135,12 +134,13 @@ AdWriteBuffer ( char FilenameBuf[20]; + /****************************************************************************** * * FUNCTION: AfGenerateFilename * - * PARAMETERS: Prefix - prefix string - * TableId - The table ID + * PARAMETERS: Prefix - prefix string + * TableId - The table ID * * RETURN: Pointer to the completed string * @@ -180,9 +180,9 @@ AdGenerateFilename ( * * FUNCTION: AfWriteBuffer * - * PARAMETERS: Filename - name of file - * Buffer - data to write - * Length - length of data + * PARAMETERS: Filename - name of file + * Buffer - data to write + * Length - length of data * * RETURN: Actual number of bytes written * @@ -217,10 +217,10 @@ AdWriteBuffer ( * * FUNCTION: AfWriteTable * - * PARAMETERS: Table - pointer to the ACPI table - * Length - length of the table - * TableName - the table signature - * OemTableID - from the table header + * PARAMETERS: Table - pointer to the ACPI table + * Length - length of the table + * TableName - the table signature + * OemTableID - from the table header * * RETURN: None * @@ -272,7 +272,7 @@ FlGenerateFilename ( * Copy the original filename to a new buffer. Leave room for the worst case * where we append the suffix, an added dot and the null terminator. */ - NewFilename = ACPI_ALLOCATE_ZEROED ( + NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); strcpy (NewFilename, InputFilename); @@ -314,7 +314,7 @@ FlStrdup ( char *NewString; - NewString = ACPI_ALLOCATE (strlen (String) + 1); + NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1); if (!NewString) { return (NULL); Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/adisasm.c Mon Oct 19 16:12:58 2009 (r198237) @@ -132,14 +132,18 @@ #define _COMPONENT ACPI_TOOLS ACPI_MODULE_NAME ("adisasm") -extern int AslCompilerdebug; + +extern int AslCompilerdebug; +extern char *Gbl_ExternalFilename; + ACPI_STATUS LsDisplayNamespace ( void); void -LsSetupNsList (void * Handle); +LsSetupNsList ( + void *Handle); /* Local prototypes */ @@ -153,14 +157,6 @@ void AdDisassemblerHeader ( char *Filename); -void -AdAddExternalsToNamespace ( - void); - -UINT32 -AdMethodExternalCount ( - void); - ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, @@ -171,8 +167,6 @@ ACPI_STATUS AdParseDeferredOps ( ACPI_PARSE_OBJECT *Root); -ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; - /* Stubs for ASL compiler */ @@ -192,7 +186,6 @@ AcpiDsMethodError ( { return (Status); } - #endif ACPI_STATUS @@ -238,18 +231,19 @@ AcpiDsMethodDataInitArgs ( } -ACPI_TABLE_DESC LocalTables[1]; +static ACPI_TABLE_DESC LocalTables[1]; +static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; /******************************************************************************* * * FUNCTION: AdInitialize * - * PARAMETERS: None. + * PARAMETERS: None * * RETURN: Status * - * DESCRIPTION: CA initialization + * DESCRIPTION: ACPICA and local initialization * ******************************************************************************/ @@ -296,89 +290,15 @@ AdInitialize ( } -/******************************************************************************* - * - * FUNCTION: AdAddExternalsToNamespace - * - * PARAMETERS: - * - * RETURN: None - * - * DESCRIPTION: - * - ******************************************************************************/ - -void -AdAddExternalsToNamespace ( - void) -{ - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - ACPI_OPERAND_OBJECT *MethodDesc; - - - while (External) - { - Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); - - if (External->Type == ACPI_TYPE_METHOD) - { - MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - MethodDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = MethodDesc; - } - - External = External->Next; - } -} - - -/******************************************************************************* - * - * FUNCTION: AdMethodExternalCount - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Return the number of externals that have been generated - * - ******************************************************************************/ - -UINT32 -AdMethodExternalCount ( - void) -{ - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - UINT32 Count = 0; - - - while (External) - { - if (External->Type == ACPI_TYPE_METHOD) - { - Count++; - } - - External = External->Next; - } - - return (Count); -} - - /****************************************************************************** * * FUNCTION: AdAmlDisassemble * - * PARAMETERS: Filename - AML input filename - * OutToFile - TRUE if output should go to a file - * Prefix - Path prefix for output - * OutFilename - where the filename is returned - * GetAllTables - TRUE if all tables are desired + * PARAMETERS: Filename - AML input filename + * OutToFile - TRUE if output should go to a file + * Prefix - Path prefix for output + * OutFilename - where the filename is returned + * GetAllTables - TRUE if all tables are desired * * RETURN: Status * @@ -386,8 +306,6 @@ AdMethodExternalCount ( * *****************************************************************************/ -extern char *Gbl_ExternalFilename; - ACPI_STATUS AdAmlDisassemble ( BOOLEAN OutToFile, @@ -403,12 +321,11 @@ AdAmlDisassemble ( ACPI_TABLE_HEADER *Table = NULL; ACPI_TABLE_HEADER *ExternalTable; ACPI_OWNER_ID OwnerId; - ACPI_EXTERNAL_LIST *NextExternal; /* - * Input: AML Code from either a file, - * or via GetTables (memory or registry) + * Input: AML code from either a file or via GetTables (memory or + * registry) */ if (Filename) { @@ -462,13 +379,7 @@ AdAmlDisassemble ( /* Clear external list generated by Scope in external tables */ - while (AcpiGbl_ExternalList) - { - NextExternal = AcpiGbl_ExternalList->Next; - ACPI_FREE (AcpiGbl_ExternalList->Path); - ACPI_FREE (AcpiGbl_ExternalList); - AcpiGbl_ExternalList = NextExternal; - } + AcpiDmClearExternalList (); } } else @@ -501,8 +412,7 @@ AdAmlDisassemble ( } /* - * Output: ASL code. - * Redirect to a file if requested + * Output: ASL code. Redirect to a file if requested */ if (OutToFile) { @@ -589,11 +499,11 @@ AdAmlDisassemble ( * tree with the new information (namely, the number of arguments per * method) */ - if (AdMethodExternalCount ()) + if (AcpiDmGetExternalMethodCount ()) { fprintf (stderr, "\nFound %d external control methods, reparsing with new information\n", - AdMethodExternalCount()); + AcpiDmGetExternalMethodCount ()); /* * Reparse, rebuild namespace. no need to xref namespace @@ -611,7 +521,7 @@ AdAmlDisassemble ( AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; Status = AcpiNsRootInitialize (); - AdAddExternalsToNamespace (); + AcpiDmAddExternalsToNamespace (); /* Parse table. No need to reload it, however (FALSE) */ @@ -855,9 +765,9 @@ AdDisplayTables ( * * FUNCTION: AdDeferredParse * - * PARAMETERS: Op - Root Op of the deferred opcode - * Aml - Pointer to the raw AML - * AmlLength - Length of the AML + * PARAMETERS: Op - Root Op of the deferred opcode + * Aml - Pointer to the raw AML + * AmlLength - Length of the AML * * RETURN: Status * @@ -981,7 +891,7 @@ AdDeferredParse ( * * FUNCTION: AdParseDeferredOps * - * PARAMETERS: Root - Root of the parse tree + * PARAMETERS: Root - Root of the parse tree * * RETURN: Status * @@ -1055,8 +965,8 @@ AdParseDeferredOps ( * * FUNCTION: AdGetLocalTables * - * PARAMETERS: Filename - Not used - * GetAllTables - TRUE if all tables are desired + * PARAMETERS: Filename - Not used + * GetAllTables - TRUE if all tables are desired * * RETURN: Status * @@ -1138,6 +1048,11 @@ AdGetLocalTables ( Status = AcpiTbStoreTable (0, NewTable, NewTable->Length, 0, &TableIndex); + if (ACPI_FAILURE (Status)) + { + fprintf (stderr, "Could not store DSDT\n"); + return AE_NO_ACPI_TABLES; + } } else { @@ -1169,10 +1084,10 @@ AdGetLocalTables ( * * FUNCTION: AdParseTable * - * PARAMETERS: Table - Pointer to the raw table - * OwnerId - Returned OwnerId of the table - * LoadTable - If add table to the global table list - * External - If this is an external table + * PARAMETERS: Table - Pointer to the raw table + * OwnerId - Returned OwnerId of the table + * LoadTable - If add table to the global table list + * External - If this is an external table * * RETURN: Status * Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/adwalk.c Mon Oct 19 16:12:58 2009 (r198237) @@ -118,7 +118,6 @@ #include #include #include -#include #include #include #include @@ -184,7 +183,7 @@ AcpiDmResourceDescendingOp ( * * FUNCTION: AcpiDmDumpTree * - * PARAMETERS: Origin - Starting object + * PARAMETERS: Origin - Starting object * * RETURN: None * @@ -218,7 +217,7 @@ AcpiDmDumpTree ( * * FUNCTION: AcpiDmFindOrphanMethods * - * PARAMETERS: Origin - Starting object + * PARAMETERS: Origin - Starting object * * RETURN: None * @@ -426,7 +425,6 @@ AcpiDmDumpDescending ( void *Context) { ACPI_OP_WALK_INFO *Info = Context; - const ACPI_OPCODE_INFO *OpInfo; char *Path; @@ -435,11 +433,9 @@ AcpiDmDumpDescending ( return (AE_OK); } - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - Info->Count++; - /* Most of the information (count, level, name) here */ + Info->Count++; AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level); AcpiDmIndent (Level); AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode)); @@ -472,7 +468,7 @@ AcpiDmDumpDescending ( case AML_METHOD_OP: case AML_DEVICE_OP: case AML_INT_NAMEDFIELD_OP: - AcpiOsPrintf ("%4.4s", &Op->Named.Name); + AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name)); break; default: @@ -536,7 +532,7 @@ AcpiDmFindOrphanDescending ( { /* This NamePath has no args, assume it is an integer */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } @@ -547,11 +543,11 @@ AcpiDmFindOrphanDescending ( { /* One Arg means this is just a Store(Name,Target) */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; #endif @@ -567,7 +563,7 @@ AcpiDmFindOrphanDescending ( { /* This NamePath has no args, assume it is an integer */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } @@ -576,11 +572,11 @@ AcpiDmFindOrphanDescending ( { /* One Arg means this is just a Store(Name,Target) */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; @@ -611,7 +607,7 @@ AcpiDmFindOrphanDescending ( /* And namepath is the first argument */ (ParentOp->Common.Value.Arg == Op)) { - AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0); break; } } @@ -621,7 +617,7 @@ AcpiDmFindOrphanDescending ( * operator) - it *must* be a method invocation, nothing else is * grammatically possible. */ - AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; @@ -858,7 +854,7 @@ AcpiDmXrefDescendingOp ( { if (Status == AE_NOT_FOUND) { - AcpiDmAddToExternalList (Path, (UINT8) ObjectType, 0); + AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0); /* * We could install this into the namespace, but we catch duplicate @@ -888,12 +884,12 @@ AcpiDmXrefDescendingOp ( if (ObjectType2 == ACPI_TYPE_METHOD) { - AcpiDmAddToExternalList (Path, ACPI_TYPE_METHOD, + AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_METHOD, Object->Method.ParamCount); } else { - AcpiDmAddToExternalList (Path, (UINT8) ObjectType2, 0); + AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, 0); } Op->Common.Node = Node; Copied and modified: head/sys/contrib/dev/acpica/common/dmextern.c (from r198235, vendor-sys/acpica/dist/common/dmextern.c) ============================================================================== --- vendor-sys/acpica/dist/common/dmextern.c Mon Oct 19 15:50:59 2009 (r198235, copy source) +++ head/sys/contrib/dev/acpica/common/dmextern.c Mon Oct 19 16:12:58 2009 (r198237) @@ -113,11 +113,11 @@ * *****************************************************************************/ -#include "acpi.h" -#include "accommon.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acdisasm.h" +#include +#include +#include +#include +#include /* Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/dmtable.c Mon Oct 19 16:12:58 2009 (r198237) @@ -218,7 +218,6 @@ static const char *AcpiDmIvrsS }; - #define ACPI_FADT_PM_RESERVED 8 static const char *AcpiDmFadtProfiles[] = @@ -954,7 +953,7 @@ AcpiDmCheckAscii ( for (i = 0; i < Count; i++) { - RepairedName[i] = Name[i]; + RepairedName[i] = (char) Name[i]; if (!Name[i]) { Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/getopt.c Mon Oct 19 16:12:58 2009 (r198237) @@ -195,9 +195,9 @@ AcpiGetopt( if (*++OptsPtr == ':') { - if (argv[AcpiGbl_Optind][CurrentCharPtr+1] != '\0') + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') { - AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][CurrentCharPtr+1]; + AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; } else if (++AcpiGbl_Optind >= argc) { @@ -218,9 +218,9 @@ AcpiGetopt( else if (*OptsPtr == '^') { - if (argv[AcpiGbl_Optind][CurrentCharPtr+1] != '\0') + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') { - AcpiGbl_Optarg = &argv[AcpiGbl_Optind][CurrentCharPtr+1]; + AcpiGbl_Optarg = &argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)]; } else { Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Mon Oct 19 16:12:58 2009 (r198237) @@ -575,7 +575,9 @@ LdNamespace1Begin ( goto FinishNode; } - AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); + AslCoreSubsystemError (Op, Status, + "Failure from namespace lookup", FALSE); + goto Exit; } @@ -718,7 +720,7 @@ LdNamespace1Begin ( else { AslCoreSubsystemError (Op, Status, - "Failure from lookup %s\n", FALSE); + "Failure from namespace lookup", FALSE); goto Exit; } } @@ -885,7 +887,8 @@ LdNamespace2Begin ( return (AE_OK); } - AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); + AslCoreSubsystemError (Op, Status, + "Failure from namespace lookup", FALSE); return (AE_OK); } Modified: head/sys/contrib/dev/acpica/debugger/dbcmds.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbcmds.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/debugger/dbcmds.c Mon Oct 19 16:12:58 2009 (r198237) @@ -130,6 +130,7 @@ #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbcmds") + /* Local prototypes */ static ACPI_STATUS @@ -501,7 +502,7 @@ AcpiDbWalkForExecute ( void **ReturnValue) { ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - UINT32 *Count = (UINT32 *) Context; + ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context; ACPI_BUFFER ReturnObj; ACPI_STATUS Status; char *Pathname; @@ -542,7 +543,6 @@ AcpiDbWalkForExecute ( if (ObjInfo->Type == ACPI_TYPE_METHOD) { - /* Setup default parameters */ for (i = 0; i < ObjInfo->ParamCount; i++) @@ -556,11 +556,9 @@ AcpiDbWalkForExecute ( } ACPI_FREE (ObjInfo); - ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; - /* Do the actual method execution */ AcpiGbl_MethodExecuting = TRUE; @@ -569,11 +567,21 @@ AcpiDbWalkForExecute ( AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status)); AcpiGbl_MethodExecuting = FALSE; - ACPI_FREE (Pathname); - (*Count)++; - return (AE_OK); + /* Ignore status from method execution */ + + Status = AE_OK; + + /* Update count, check if we have executed enough methods */ + + Info->Count++; + if (Info->Count >= Info->MaxCount) + { + Status = AE_CTRL_TERMINATE; + } + + return (Status); } @@ -581,27 +589,37 @@ AcpiDbWalkForExecute ( * * FUNCTION: AcpiDbBatchExecute * - * PARAMETERS: None + * PARAMETERS: CountArg - Max number of methods to execute * * RETURN: None * - * DESCRIPTION: Namespace batch execution. + * DESCRIPTION: Namespace batch execution. Execute predefined names in the + * namespace, up to the max count, if specified. * ******************************************************************************/ void AcpiDbBatchExecute ( - void) + char *CountArg) { - UINT32 Count = 0; + ACPI_EXECUTE_WALK Info; + + + Info.Count = 0; + Info.MaxCount = ACPI_UINT32_MAX; + + if (CountArg) + { + Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0); + } /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForExecute, (void *) &Count, NULL); + AcpiDbWalkForExecute, (void *) &Info, NULL); - AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Count); + AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Info.Count); } Modified: head/sys/contrib/dev/acpica/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbinput.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/debugger/dbinput.c Mon Oct 19 16:12:58 2009 (r198237) @@ -644,7 +644,7 @@ AcpiDbCommandDispatch ( break; case CMD_BATCH: - AcpiDbBatchExecute (); + AcpiDbBatchExecute (AcpiGbl_DbArgs[1]); break; case CMD_BREAKPOINT: Modified: head/sys/contrib/dev/acpica/disassembler/dmutils.c ============================================================================== --- head/sys/contrib/dev/acpica/disassembler/dmutils.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/disassembler/dmutils.c Mon Oct 19 16:12:58 2009 (r198237) @@ -129,9 +129,6 @@ ACPI_MODULE_NAME ("dmutils") -ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList = NULL; - - /* Data used in keeping track of fields */ #if 0 const char *AcpiGbl_FENames[] = @@ -202,121 +199,6 @@ const char *AcpiGbl }; -#ifdef ACPI_ASL_COMPILER -/******************************************************************************* - * - * FUNCTION: AcpiDmAddToExternalList - * - * PARAMETERS: Path - Internal (AML) path to the object - * - * RETURN: None - * - * DESCRIPTION: Insert a new path into the list of Externals which will in - * turn be emitted as an External() declaration in the disassembled - * output. - * - ******************************************************************************/ - -void -AcpiDmAddToExternalList ( - char *Path, - UINT8 Type, - UINT32 Value) -{ - char *ExternalPath; - ACPI_EXTERNAL_LIST *NewExternal; - ACPI_EXTERNAL_LIST *NextExternal; - ACPI_EXTERNAL_LIST *PrevExternal = NULL; - ACPI_STATUS Status; - - - if (!Path) - { - return; - } - - /* Externalize the ACPI path */ - - Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, - NULL, &ExternalPath); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Ensure that we don't have duplicate externals */ - - NextExternal = AcpiGbl_ExternalList; - while (NextExternal) - { - /* Allow upgrade of type from ANY */ - - if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) - { - /* Duplicate method, check that the Value (ArgCount) is the same */ - - if ((NextExternal->Type == ACPI_TYPE_METHOD) && - (NextExternal->Value != Value)) - { - ACPI_ERROR ((AE_INFO, "Argument count mismatch for method %s %d %d", - NextExternal->Path, NextExternal->Value, Value)); - } - if (NextExternal->Type == ACPI_TYPE_ANY) - { - NextExternal->Type = Type; - NextExternal->Value = Value; - } - ACPI_FREE (ExternalPath); - return; - } - NextExternal = NextExternal->Next; - } - - /* Allocate and init a new External() descriptor */ - - NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); - NewExternal->InternalPath = Path; - NewExternal->Path = ExternalPath; - NewExternal->Type = Type; - NewExternal->Value = Value; - NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); - - /* Link the new descriptor into the global list, ordered by string length */ - - NextExternal = AcpiGbl_ExternalList; - while (NextExternal) - { - if (NewExternal->Length <= NextExternal->Length) - { - if (PrevExternal) - { - PrevExternal->Next = NewExternal; - } - else - { - AcpiGbl_ExternalList = NewExternal; - } - - NewExternal->Next = NextExternal; - return; - } - - PrevExternal = NextExternal; - NextExternal = NextExternal->Next; - } - - if (PrevExternal) - { - PrevExternal->Next = NewExternal; - } - else - { - AcpiGbl_ExternalList = NewExternal; - } -} -#endif - - /******************************************************************************* * * FUNCTION: AcpiDmDecodeAttribute Modified: head/sys/contrib/dev/acpica/disassembler/dmwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/disassembler/dmwalk.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/disassembler/dmwalk.c Mon Oct 19 16:12:58 2009 (r198237) @@ -130,6 +130,17 @@ #define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: " +/* Stub for non-compiler code */ + +#ifndef ACPI_ASL_COMPILER +void +AcpiDmEmitExternals ( + void) +{ + return; +} +#endif + /* Local prototypes */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 18:46:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4C331065676; Mon, 19 Oct 2009 18:46:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 945418FC0A; Mon, 19 Oct 2009 18:46:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JIkMPu009598; Mon, 19 Oct 2009 18:46:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JIkMWP009593; Mon, 19 Oct 2009 18:46:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910191846.n9JIkMWP009593@svn.freebsd.org> From: Rui Paulo Date: Mon, 19 Oct 2009 18:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198242 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 18:46:22 -0000 Author: rpaulo Date: Mon Oct 19 18:46:22 2009 New Revision: 198242 URL: http://svn.freebsd.org/changeset/base/198242 Log: Implement the missing support for updating the mesh conf number of neighbors via ieee80211_beacon_notify(). MFC after: 3 days Modified: head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Mon Oct 19 18:31:39 2009 (r198241) +++ head/sys/net80211/ieee80211_mesh.c Mon Oct 19 18:46:22 2009 (r198242) @@ -739,10 +739,12 @@ mesh_linkchange(struct ieee80211_node *n ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) { KASSERT(ms->ms_neighbors < 65535, ("neighbor count overflow")); ms->ms_neighbors++; + ieee80211_beacon_notify(vap, IEEE80211_BEACON_MESHCONF); } else if (ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED && state != IEEE80211_NODE_MESH_ESTABLISHED) { KASSERT(ms->ms_neighbors > 0, ("neighbor count 0")); ms->ms_neighbors--; + ieee80211_beacon_notify(vap, IEEE80211_BEACON_MESHCONF); } ni->ni_mlstate = state; switch (state) { @@ -2553,6 +2555,18 @@ ieee80211_mesh_init_neighbor(struct ieee ieee80211_parse_meshid(ni, sp->meshid); } +void +ieee80211_mesh_update_beacon(struct ieee80211vap *vap, + struct ieee80211_beacon_offsets *bo) +{ + KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap")); + + if (isset(bo->bo_flags, IEEE80211_BEACON_MESHCONF)) { + (void)ieee80211_add_meshconf(bo->bo_meshconf, vap); + clrbit(bo->bo_flags, IEEE80211_BEACON_MESHCONF); + } +} + static int mesh_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Mon Oct 19 18:31:39 2009 (r198241) +++ head/sys/net80211/ieee80211_mesh.h Mon Oct 19 18:46:22 2009 (r198242) @@ -470,6 +470,8 @@ struct ieee80211_scanparams; void ieee80211_mesh_init_neighbor(struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_scanparams *); +void ieee80211_mesh_update_beacon(struct ieee80211vap *, + struct ieee80211_beacon_offsets *); /* * Return non-zero if proxy operation is enabled. Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Mon Oct 19 18:31:39 2009 (r198241) +++ head/sys/net80211/ieee80211_output.c Mon Oct 19 18:46:22 2009 (r198242) @@ -2658,6 +2658,7 @@ ieee80211_beacon_construct(struct mbuf * #ifdef IEEE80211_SUPPORT_MESH if (vap->iv_opmode == IEEE80211_M_MBSS) { frm = ieee80211_add_meshid(frm, vap); + bo->bo_meshconf = frm; frm = ieee80211_add_meshconf(frm, vap); } #endif @@ -2874,6 +2875,11 @@ ieee80211_beacon_update(struct ieee80211 ieee80211_tdma_update_beacon(vap, bo); } #endif +#ifdef IEEE80211_SUPPORT_MESH + if (vap->iv_opmode == IEEE80211_M_MBSS) + ieee80211_mesh_update_beacon(vap, bo); +#endif + if (vap->iv_opmode == IEEE80211_M_HOSTAP || vap->iv_opmode == IEEE80211_M_MBSS) { /* NB: no IBSS support*/ struct ieee80211_tim_ie *tie = @@ -2928,6 +2934,9 @@ ieee80211_beacon_update(struct ieee80211 #ifdef IEEE80211_TDMA_SUPPORT bo->bo_tdma += adjust; #endif +#ifdef IEEE80211_MESH_SUPPORT + bo->bo_meshconf += adjust; +#endif bo->bo_appie += adjust; bo->bo_wme += adjust; bo->bo_csa += adjust; @@ -2979,6 +2988,9 @@ ieee80211_beacon_update(struct ieee80211 #ifdef IEEE80211_TDMA_SUPPORT bo->bo_tdma += sizeof(*csa); #endif +#ifdef IEEE80211_MESH_SUPPORT + bo->bo_meshconf += sizeof(*csa); +#endif bo->bo_appie += sizeof(*csa); bo->bo_csa_trailer_len += sizeof(*csa); bo->bo_tim_trailer_len += sizeof(*csa); Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Mon Oct 19 18:31:39 2009 (r198241) +++ head/sys/net80211/ieee80211_proto.h Mon Oct 19 18:46:22 2009 (r198242) @@ -317,7 +317,8 @@ struct ieee80211_beacon_offsets { uint16_t bo_appie_len; /* AppIE length in bytes */ uint16_t bo_csa_trailer_len;; uint8_t *bo_csa; /* start of CSA element */ - uint8_t *bo_spare[4]; + uint8_t *bo_meshconf; /* start of MESHCONF element */ + uint8_t *bo_spare[3]; }; struct mbuf *ieee80211_beacon_alloc(struct ieee80211_node *, struct ieee80211_beacon_offsets *); @@ -345,6 +346,7 @@ enum { IEEE80211_BEACON_CSA = 7, /* Channel Switch Announcement */ IEEE80211_BEACON_TDMA = 9, /* TDMA Info */ IEEE80211_BEACON_ATH = 10, /* ATH parameters */ + IEEE80211_BEACON_MESHCONF = 11, /* Mesh Configuration */ }; int ieee80211_beacon_update(struct ieee80211_node *, struct ieee80211_beacon_offsets *, struct mbuf *, int mcast); From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 20:51:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79E8A106566B; Mon, 19 Oct 2009 20:51:27 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68D918FC17; Mon, 19 Oct 2009 20:51:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JKpRbH013677; Mon, 19 Oct 2009 20:51:27 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JKpREx013674; Mon, 19 Oct 2009 20:51:27 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200910192051.n9JKpREx013674@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 19 Oct 2009 20:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198250 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 20:51:27 -0000 Author: gallatin Date: Mon Oct 19 20:51:27 2009 New Revision: 198250 URL: http://svn.freebsd.org/changeset/base/198250 Log: Move mxge(4)'s NIC watchdog reset handler from a callout to a taskqueue Modified: head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Oct 19 20:16:56 2009 (r198249) +++ head/sys/dev/mxge/if_mxge.c Mon Oct 19 20:51:27 2009 (r198250) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* count xmits ourselves, rather than via drbr */ #define NO_SLOW_STATS @@ -3739,12 +3740,11 @@ mxge_read_reboot(mxge_softc_t *sc) return (pci_read_config(dev, vs + 0x14, 4)); } -static int -mxge_watchdog_reset(mxge_softc_t *sc, int slice) +static void +mxge_watchdog_reset(mxge_softc_t *sc) { struct pci_devinfo *dinfo; struct mxge_slice_state *ss; - mxge_tx_ring_t *tx; int err, running, s, num_tx_slices = 1; uint32_t reboot; uint16_t cmd; @@ -3771,7 +3771,6 @@ mxge_watchdog_reset(mxge_softc_t *sc, in cmd = pci_read_config(sc->dev, PCIR_COMMAND, 2); if (cmd == 0xffff) { device_printf(sc->dev, "NIC disappeared!\n"); - return (err); } } if ((cmd & PCIM_CMD_BUSMASTEREN) == 0) { @@ -3830,24 +3829,43 @@ mxge_watchdog_reset(mxge_softc_t *sc, in } sc->watchdog_resets++; } else { - tx = &sc->ss[slice].tx; - device_printf(sc->dev, - "NIC did not reboot, slice %d ring state:\n", - slice); device_printf(sc->dev, - "tx.req=%d tx.done=%d, tx.queue_active=%d\n", - tx->req, tx->done, tx->queue_active); - device_printf(sc->dev, "tx.activate=%d tx.deactivate=%d\n", - tx->activate, tx->deactivate); - device_printf(sc->dev, "pkt_done=%d fw=%d\n", - tx->pkt_done, - be32toh(sc->ss->fw_stats->send_done_count)); - device_printf(sc->dev, "not resetting\n"); + "NIC did not reboot, not resetting\n"); + err = 0; } - if (err) + if (err) { device_printf(sc->dev, "watchdog reset failed\n"); + } else { + if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) + callout_reset(&sc->co_hdl, mxge_ticks, + mxge_tick, sc); + } +} - return (err); +static void +mxge_watchdog_task(void *arg, int pending) +{ + mxge_softc_t *sc = arg; + + + mtx_lock(&sc->driver_mtx); + mxge_watchdog_reset(sc); + mtx_unlock(&sc->driver_mtx); +} + +static void +mxge_warn_stuck(mxge_softc_t *sc, mxge_tx_ring_t *tx, int slice) +{ + tx = &sc->ss[slice].tx; + device_printf(sc->dev, "slice %d struck? ring state:\n", slice); + device_printf(sc->dev, + "tx.req=%d tx.done=%d, tx.queue_active=%d\n", + tx->req, tx->done, tx->queue_active); + device_printf(sc->dev, "tx.activate=%d tx.deactivate=%d\n", + tx->activate, tx->deactivate); + device_printf(sc->dev, "pkt_done=%d fw=%d\n", + tx->pkt_done, + be32toh(sc->ss->fw_stats->send_done_count)); } static int @@ -3871,8 +3889,11 @@ mxge_watchdog(mxge_softc_t *sc) tx->watchdog_req != tx->watchdog_done && tx->done == tx->watchdog_done) { /* check for pause blocking before resetting */ - if (tx->watchdog_rx_pause == rx_pause) - err = mxge_watchdog_reset(sc, i); + if (tx->watchdog_rx_pause == rx_pause) { + mxge_warn_stuck(sc, tx, i); + taskqueue_enqueue(sc->tq, &sc->watchdog_task); + return (ENXIO); + } else device_printf(sc->dev, "Flow control blocking " "xmits, check link partner\n"); @@ -4558,6 +4579,17 @@ mxge_attach(device_t dev) sc->dev = dev; mxge_fetch_tunables(sc); + TASK_INIT(&sc->watchdog_task, 1, mxge_watchdog_task, sc); + sc->tq = taskqueue_create_fast("mxge_taskq", M_WAITOK, + taskqueue_thread_enqueue, + &sc->tq); + if (sc->tq == NULL) { + err = ENOMEM; + goto abort_with_nothing; + } + taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->dev)); + err = bus_dma_tag_create(NULL, /* parent */ 1, /* alignment */ 0, /* boundary */ @@ -4574,7 +4606,7 @@ mxge_attach(device_t dev) if (err != 0) { device_printf(sc->dev, "Err %d allocating parent dmat\n", err); - goto abort_with_nothing; + goto abort_with_tq; } ifp = sc->ifp = if_alloc(IFT_ETHER); @@ -4736,7 +4768,12 @@ abort_with_lock: if_free(ifp); abort_with_parent_dmat: bus_dma_tag_destroy(sc->parent_dmat); - +abort_with_tq: + if (sc->tq != NULL) { + taskqueue_drain(sc->tq, &sc->watchdog_task); + taskqueue_free(sc->tq); + sc->tq = NULL; + } abort_with_nothing: return err; } @@ -4757,6 +4794,11 @@ mxge_detach(device_t dev) mxge_close(sc, 0); mtx_unlock(&sc->driver_mtx); ether_ifdetach(sc->ifp); + if (sc->tq != NULL) { + taskqueue_drain(sc->tq, &sc->watchdog_task); + taskqueue_free(sc->tq); + sc->tq = NULL; + } callout_drain(&sc->co_hdl); ifmedia_removeall(&sc->media); mxge_dummy_rdma(sc, 0); Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Mon Oct 19 20:16:56 2009 (r198249) +++ head/sys/dev/mxge/if_mxge_var.h Mon Oct 19 20:51:27 2009 (r198250) @@ -270,6 +270,8 @@ struct mxge_softc { int dying; mxge_dma_t dmabench_dma; struct callout co_hdl; + struct taskqueue *tq; + struct task watchdog_task; struct sysctl_oid *slice_sysctl_tree; struct sysctl_ctx_list slice_sysctl_ctx; char *mac_addr_string; From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 20:58:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C5611065670; Mon, 19 Oct 2009 20:58:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC7DC8FC20; Mon, 19 Oct 2009 20:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JKwAJj014458; Mon, 19 Oct 2009 20:58:10 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JKwApb014449; Mon, 19 Oct 2009 20:58:10 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200910192058.n9JKwApb014449@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Oct 2009 20:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198251 - in head/sys: compat/x86bios conf contrib/x86emu dev/atkbdc dev/dpms dev/fb dev/pci modules/dpms modules/vesa modules/x86bios X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 20:58:11 -0000 Author: jkim Date: Mon Oct 19 20:58:10 2009 New Revision: 198251 URL: http://svn.freebsd.org/changeset/base/198251 Log: Rewrite x86bios and update its dependent drivers. - Do not map entire real mode memory (1MB). Instead, we map IVT/BDA and ROM area separately. Most notably, ROM area is mapped as device memory (uncacheable) as it should be. User memory is dynamically allocated and free'ed with contigmalloc(9) and contigfree(9). Remove now redundant and potentially dangerous x86bios_alloc.c. If this emulator ever grows to support non-PC hardware, we may implement it with rman(9) later. - Move all host-specific initializations from x86emu_util.c to x86bios.c and remove now unnecessary x86emu_util.c. Currently, non-PC hardware is not supported. We may use bus_space(9) later when the KPI is fixed. - Replace all bzero() calls for emulated registers with more obviously named x86bios_init_regs(). This function also initializes DS and SS properly. - Add x86bios_get_intr(). This function checks if the interrupt vector is available for the platform. It is not necessary for PC-compatible hardware but it may be needed later. ;-) - Do not try turning off monitor if DPMS does not support the state. - Allocate stable memory for VESA OEM strings instead of just holding pointers to them. They may or may not be accessible always. Fix a memory leak of video mode table while I am here. - Add (experimental) BIOS POST call for vesa(4). This function calls VGA BIOS POST code from the current VGA option ROM. Some video controllers cannot save and restore the state properly even if it is claimed to be supported. Usually the symptom is blank display after resuming from suspend state. If the video mode does not match the previous mode after restoring, we try BIOS POST and force the known good initial state. Some magic was taken from NetBSD (and it was taken from vbetool, I believe.) - Add a loader tunable for vgapci(4) to give a hint to dpms(4) and vesa(4) to identify who owns the VESA BIOS. This is very useful for multi-display adapter setup. By default, the POST video controller is automatically probed and the tunable "hw.pci.default_vgapci_unit" is set to corresponding vgapci unit number. You may override it from loader but it is very unlikely to be necessary. Unfortunately only AGP/PCI/PCI-E controllers can be matched because ISA controller does not have necessary device IDs. - Fix a long standing bug in state save/restore function. The state buffer pointer should be ES:BX, not ES:DI according to VBE 3.0. If it ever worked, that's because BX was always zero. :-) - Clean up register initializations more clearer per VBE 3.0. - Fix a lot of style issues with vesa(4). Deleted: head/sys/compat/x86bios/x86bios_alloc.c head/sys/contrib/x86emu/x86emu_util.c Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/atkbdc/atkbd.c head/sys/dev/dpms/dpms.c head/sys/dev/fb/vesa.c head/sys/dev/pci/vga_pci.c head/sys/modules/dpms/Makefile head/sys/modules/vesa/Makefile head/sys/modules/x86bios/Makefile Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Mon Oct 19 20:51:27 2009 (r198250) +++ head/sys/compat/x86bios/x86bios.c Mon Oct 19 20:58:10 2009 (r198251) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009 Alex Keda + * Copyright (c) 2009 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,7 +23,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * */ #include @@ -31,29 +31,153 @@ __FBSDID("$FreeBSD$"); #include "opt_x86bios.h" #include +#include #include #include +#include #include #include +#include + +#include +#include +#include + +#include +#include + +#include #include #include -#include +#define X86BIOS_PAGE_SIZE 0x00001000 /* 4K */ -#include -#include -#include +#define X86BIOS_IVT_SIZE 0x00000500 /* 1K + 256 (BDA) */ +#define X86BIOS_SEG_SIZE 0x00010000 /* 64K */ +#define X86BIOS_MEM_SIZE 0x00100000 /* 1M */ + +#define X86BIOS_IVT_BASE 0x00000000 +#define X86BIOS_RAM_BASE 0x00001000 +#define X86BIOS_ROM_BASE 0x000a0000 /* XXX EBDA? */ -u_char *pbiosMem = NULL; -static u_char *pbiosStack = NULL; +#define X86BIOS_ROM_SIZE (X86BIOS_MEM_SIZE - X86BIOS_ROM_BASE) -int busySegMap[5]; +#define X86BIOS_PAGES (X86BIOS_MEM_SIZE / X86BIOS_PAGE_SIZE) + +#define X86BIOS_R_DS _pad1 +#define X86BIOS_R_SS _pad2 static struct x86emu x86bios_emu; static struct mtx x86bios_lock; +static void *x86bios_ivt; +static void *x86bios_rom; +static void *x86bios_seg; + +static vm_offset_t *x86bios_map; + +static vm_paddr_t x86bios_seg_phys; + +static void * +x86bios_get_pages(uint32_t offset, size_t size) +{ + int i; + + if (offset + size > X86BIOS_MEM_SIZE) + return (NULL); + + i = offset / X86BIOS_PAGE_SIZE; + if (x86bios_map[i] != 0) + return ((void *)(x86bios_map[i] + offset - + i * X86BIOS_PAGE_SIZE)); + + return (NULL); +} + +static void +x86bios_set_pages(vm_offset_t va, vm_paddr_t pa, size_t size) +{ + int i, j; + + for (i = pa / X86BIOS_PAGE_SIZE, j = 0; + j < howmany(size, X86BIOS_PAGE_SIZE); i++, j++) + x86bios_map[i] = va + j * X86BIOS_PAGE_SIZE; +} + +static uint8_t +x86bios_emu_rdb(struct x86emu *emu, uint32_t addr) +{ + uint8_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + return (*va); +} + +static uint16_t +x86bios_emu_rdw(struct x86emu *emu, uint32_t addr) +{ + uint16_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + return (le16toh(*va)); +} + +static uint32_t +x86bios_emu_rdl(struct x86emu *emu, uint32_t addr) +{ + uint32_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + return (le32toh(*va)); +} + +static void +x86bios_emu_wrb(struct x86emu *emu, uint32_t addr, uint8_t val) +{ + uint8_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + *va = val; +} + +static void +x86bios_emu_wrw(struct x86emu *emu, uint32_t addr, uint16_t val) +{ + uint16_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + *va = htole16(val); +} + +static void +x86bios_emu_wrl(struct x86emu *emu, uint32_t addr, uint32_t val) +{ + uint32_t *va; + + va = x86bios_get_pages(addr, sizeof(*va)); + if (va == NULL) + x86emu_halt_sys(emu); + + *va = htole32(val); +} + static uint8_t x86bios_emu_inb(struct x86emu *emu, uint16_t port) { @@ -62,6 +186,7 @@ x86bios_emu_inb(struct x86emu *emu, uint return (0); if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); + return (inb(port)); } @@ -71,6 +196,7 @@ x86bios_emu_inw(struct x86emu *emu, uint if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); + return (inw(port)); } @@ -80,6 +206,7 @@ x86bios_emu_inl(struct x86emu *emu, uint if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); + return (inl(port)); } @@ -91,6 +218,7 @@ x86bios_emu_outb(struct x86emu *emu, uin return; if (port >= 0x80 && port < 0x88) /* POST status register */ return; + outb(port, val); } @@ -100,6 +228,7 @@ x86bios_emu_outw(struct x86emu *emu, uin if (port >= 0x80 && port < 0x88) /* POST status register */ return; + outw(port, val); } @@ -109,9 +238,109 @@ x86bios_emu_outl(struct x86emu *emu, uin if (port >= 0x80 && port < 0x88) /* POST status register */ return; + outl(port, val); } +static void +x86bios_emu_get_intr(struct x86emu *emu, int intno) +{ + uint16_t *sp; + uint32_t iv; + + emu->x86.R_SP -= 6; + + sp = (uint16_t *)((vm_offset_t)x86bios_seg + emu->x86.R_SP); + sp[0] = htole16(emu->x86.R_IP); + sp[1] = htole16(emu->x86.R_CS); + sp[2] = htole16(emu->x86.R_FLG); + + iv = x86bios_get_intr(intno); + emu->x86.R_IP = iv & 0x000f; + emu->x86.R_CS = (iv >> 12) & 0xffff; + emu->x86.R_FLG &= ~(F_IF | F_TF); +} + +void * +x86bios_alloc(uint32_t *offset, size_t size) +{ + void *vaddr; + + if (offset == NULL || size == 0) + return (NULL); + + vaddr = contigmalloc(size, M_DEVBUF, M_NOWAIT, X86BIOS_RAM_BASE, + X86BIOS_ROM_BASE, X86BIOS_PAGE_SIZE, 0); + if (vaddr != NULL) { + *offset = vtophys(vaddr); + x86bios_set_pages((vm_offset_t)vaddr, *offset, size); + } + + return (vaddr); +} + +void +x86bios_free(void *addr, size_t size) +{ + vm_paddr_t paddr; + + if (addr == NULL || size == 0) + return; + + paddr = vtophys(addr); + if (paddr < X86BIOS_RAM_BASE || paddr >= X86BIOS_ROM_BASE || + paddr % X86BIOS_PAGE_SIZE != 0) + return; + + bzero(x86bios_map + paddr / X86BIOS_PAGE_SIZE, + sizeof(*x86bios_map) * howmany(size, X86BIOS_PAGE_SIZE)); + contigfree(addr, size, M_DEVBUF); +} + +void +x86bios_init_regs(struct x86regs *regs) +{ + + bzero(regs, sizeof(*regs)); + regs->X86BIOS_R_DS = regs->X86BIOS_R_SS = x86bios_seg_phys >> 4; +} + +void +x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off) +{ + + if (x86bios_map == NULL) + return; + + if (bootverbose) + printf("Calling 0x%05x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); + + mtx_lock_spin(&x86bios_lock); + memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); + x86emu_exec_call(&x86bios_emu, seg, off); + memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); + mtx_unlock_spin(&x86bios_lock); + + if (bootverbose) + printf("Exiting 0x%05x (ax=0x%04x bx=0x%04x " + "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", + (seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX, + regs->R_DX, regs->R_ES, regs->R_DI); +} + +uint32_t +x86bios_get_intr(int intno) +{ + uint32_t *iv; + + iv = (uint32_t *)((vm_offset_t)x86bios_ivt + intno * 4); + + return (le32toh(*iv)); +} + void x86bios_intr(struct x86regs *regs, int intno) { @@ -119,6 +348,9 @@ x86bios_intr(struct x86regs *regs, int i if (intno < 0 || intno > 255) return; + if (x86bios_map == NULL) + return; + if (bootverbose) printf("Calling int 0x%x (ax=0x%04x bx=0x%04x " "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n", @@ -126,11 +358,9 @@ x86bios_intr(struct x86regs *regs, int i regs->R_DX, regs->R_ES, regs->R_DI); mtx_lock_spin(&x86bios_lock); - memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); x86emu_exec_intr(&x86bios_emu, intno); memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); - mtx_unlock_spin(&x86bios_lock); if (bootverbose) @@ -141,24 +371,112 @@ x86bios_intr(struct x86regs *regs, int i } void * -x86bios_offset(uint32_t offs) +x86bios_offset(uint32_t offset) +{ + + return (x86bios_get_pages(offset, 1)); +} + +void * +x86bios_get_orm(uint32_t offset) { + uint8_t *p; + + /* Does the shadow ROM contain BIOS POST code for x86? */ + p = x86bios_offset(offset); + if (p == NULL || p[0] != 0x55 || p[1] != 0xaa || p[3] != 0xe9) + return (NULL); - return (pbiosMem + offs); + return (p); +} + +int +x86bios_match_device(uint32_t offset, device_t dev) +{ + uint8_t *p; + uint16_t device, vendor; + uint8_t class, progif, subclass; + + /* Does the shadow ROM contain BIOS POST code for x86? */ + p = x86bios_get_orm(offset); + if (p == NULL) + return (0); + + /* Does it contain PCI data structure? */ + p += le16toh(*(uint16_t *)(p + 0x18)); + if (bcmp(p, "PCIR", 4) != 0 || + le16toh(*(uint16_t *)(p + 0x0a)) < 0x18 || *(p + 0x14) != 0) + return (0); + + /* Does it match the vendor, device, and classcode? */ + vendor = le16toh(*(uint16_t *)(p + 0x04)); + device = le16toh(*(uint16_t *)(p + 0x06)); + progif = *(p + 0x0d); + subclass = *(p + 0x0e); + class = *(p + 0x0f); + if (vendor != pci_get_vendor(dev) || device != pci_get_device(dev) || + class != pci_get_class(dev) || subclass != pci_get_subclass(dev) || + progif != pci_get_progif(dev)) + return (0); + + return (1); +} + +static __inline int +x86bios_map_mem(void) +{ + + x86bios_ivt = pmap_mapdev(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE); + if (x86bios_ivt == NULL) + return (1); + x86bios_rom = pmap_mapdev(X86BIOS_ROM_BASE, X86BIOS_ROM_SIZE); + if (x86bios_rom == NULL) { + pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); + return (1); + } + x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK, + X86BIOS_RAM_BASE, X86BIOS_ROM_BASE, X86BIOS_PAGE_SIZE, 0); + x86bios_seg_phys = vtophys(x86bios_seg); + + return (0); +} + +static __inline void +x86bios_unmap_mem(void) +{ + + pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); + pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE); + contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF); } static void x86bios_init(void *arg __unused) { - int offs; + int i; mtx_init(&x86bios_lock, "x86bios lock", NULL, MTX_SPIN); - /* Can pbiosMem be NULL here? */ - pbiosMem = pmap_mapbios(0x0, MAPPED_MEMORY_SIZE); + if (x86bios_map_mem() != 0) + return; - memset(&x86bios_emu, 0, sizeof(x86bios_emu)); - x86emu_init_default(&x86bios_emu); + x86bios_map = malloc(sizeof(*x86bios_map) * X86BIOS_PAGES, M_DEVBUF, + M_WAITOK | M_ZERO); + x86bios_set_pages((vm_offset_t)x86bios_ivt, X86BIOS_IVT_BASE, + X86BIOS_IVT_SIZE); + x86bios_set_pages((vm_offset_t)x86bios_rom, X86BIOS_ROM_BASE, + X86BIOS_ROM_SIZE); + x86bios_set_pages((vm_offset_t)x86bios_seg, x86bios_seg_phys, + X86BIOS_SEG_SIZE); + + bzero(&x86bios_emu, sizeof(x86bios_emu)); + + x86bios_emu.emu_rdb = x86bios_emu_rdb; + x86bios_emu.emu_rdw = x86bios_emu_rdw; + x86bios_emu.emu_rdl = x86bios_emu_rdl; + x86bios_emu.emu_wrb = x86bios_emu_wrb; + x86bios_emu.emu_wrw = x86bios_emu_wrw; + x86bios_emu.emu_wrl = x86bios_emu_wrl; x86bios_emu.emu_inb = x86bios_emu_inb; x86bios_emu.emu_inw = x86bios_emu_inw; @@ -167,23 +485,24 @@ x86bios_init(void *arg __unused) x86bios_emu.emu_outw = x86bios_emu_outw; x86bios_emu.emu_outl = x86bios_emu_outl; - x86bios_emu.mem_base = (char *)pbiosMem; - x86bios_emu.mem_size = MAPPED_MEMORY_SIZE; - - memset(busySegMap, 0, sizeof(busySegMap)); - - pbiosStack = x86bios_alloc(1, &offs); + for (i = 0; i < 256; i++) + x86bios_emu._x86emu_intrTab[i] = x86bios_emu_get_intr; } static void x86bios_uninit(void *arg __unused) { + vm_offset_t *map = x86bios_map; - x86bios_free(pbiosStack, 1); + mtx_lock_spin(&x86bios_lock); + if (x86bios_map != NULL) { + free(x86bios_map, M_DEVBUF); + x86bios_map = NULL; + } + mtx_unlock_spin(&x86bios_lock); - if (pbiosMem) - pmap_unmapdev((vm_offset_t)pbiosMem, - MAPPED_MEMORY_SIZE); + if (map != NULL) + x86bios_unmap_mem(); mtx_destroy(&x86bios_lock); } @@ -191,7 +510,6 @@ x86bios_uninit(void *arg __unused) static int x86bios_modevent(module_t mod __unused, int type, void *data __unused) { - int err = 0; switch (type) { case MOD_LOAD: @@ -201,11 +519,10 @@ x86bios_modevent(module_t mod __unused, x86bios_uninit(NULL); break; default: - err = ENOTSUP; - break; + return (ENOTSUP); } - return (err); + return (0); } static moduledata_t x86bios_mod = { Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Mon Oct 19 20:51:27 2009 (r198250) +++ head/sys/compat/x86bios/x86bios.h Mon Oct 19 20:58:10 2009 (r198251) @@ -23,49 +23,51 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ */ /* * x86 registers were borrowed from x86emu.h x86emu_regs.h * for compatability. - * - * $FreeBSD$ */ #ifndef _X86BIOS_H_ -#define _X86BIOS_H_ +#define _X86BIOS_H_ -#include #include #include +#include #ifdef __BIG_ENDIAN__ struct x86_register32 { - uint32_t e_reg; + uint32_t e_reg; }; struct x86_register16 { - uint16_t filler0; - uint16_t x_reg; + uint16_t filler0; + uint16_t x_reg; }; struct x86_register8 { - uint8_t filler0, filler1; - uint8_t h_reg, l_reg; + uint8_t filler0; + uint8_t filler1; + uint8_t h_reg; + uint8_t l_reg; }; #else /* !__BIG_ENDIAN__ */ struct x86_register32 { - uint32_t e_reg; + uint32_t e_reg; }; struct x86_register16 { - uint16_t x_reg; + uint16_t x_reg; }; struct x86_register8 { - uint8_t l_reg, h_reg; + uint8_t l_reg; + uint8_t h_reg; }; #endif /* __BIG_ENDIAN__ */ @@ -77,19 +79,19 @@ union x86_register { }; struct x86regs { - uint16_t padding; /* CS is unused. */ - uint16_t register_ds; + uint16_t _pad0; /* CS */ + uint16_t _pad1; /* DS */ uint16_t register_es; uint16_t register_fs; uint16_t register_gs; - uint16_t register_ss; + uint16_t _pad2; /* SS */ uint32_t register_flags; union x86_register register_a; union x86_register register_b; union x86_register register_c; union x86_register register_d; - union x86_register register_sp; + union x86_register _pad3; /* SP */ union x86_register register_bp; union x86_register register_si; union x86_register register_di; @@ -98,60 +100,57 @@ struct x86regs { typedef struct x86regs x86regs_t; /* 8 bit registers */ -#define R_AH register_a.I8_reg.h_reg -#define R_AL register_a.I8_reg.l_reg -#define R_BH register_b.I8_reg.h_reg -#define R_BL register_b.I8_reg.l_reg -#define R_CH register_c.I8_reg.h_reg -#define R_CL register_c.I8_reg.l_reg -#define R_DH register_d.I8_reg.h_reg -#define R_DL register_d.I8_reg.l_reg +#define R_AH register_a.I8_reg.h_reg +#define R_AL register_a.I8_reg.l_reg +#define R_BH register_b.I8_reg.h_reg +#define R_BL register_b.I8_reg.l_reg +#define R_CH register_c.I8_reg.h_reg +#define R_CL register_c.I8_reg.l_reg +#define R_DH register_d.I8_reg.h_reg +#define R_DL register_d.I8_reg.l_reg /* 16 bit registers */ -#define R_AX register_a.I16_reg.x_reg -#define R_BX register_b.I16_reg.x_reg -#define R_CX register_c.I16_reg.x_reg -#define R_DX register_d.I16_reg.x_reg +#define R_AX register_a.I16_reg.x_reg +#define R_BX register_b.I16_reg.x_reg +#define R_CX register_c.I16_reg.x_reg +#define R_DX register_d.I16_reg.x_reg /* 32 bit extended registers */ -#define R_EAX register_a.I32_reg.e_reg -#define R_EBX register_b.I32_reg.e_reg -#define R_ECX register_c.I32_reg.e_reg -#define R_EDX register_d.I32_reg.e_reg +#define R_EAX register_a.I32_reg.e_reg +#define R_EBX register_b.I32_reg.e_reg +#define R_ECX register_c.I32_reg.e_reg +#define R_EDX register_d.I32_reg.e_reg /* special registers */ -#define R_SP register_sp.I16_reg.x_reg -#define R_BP register_bp.I16_reg.x_reg -#define R_SI register_si.I16_reg.x_reg -#define R_DI register_di.I16_reg.x_reg -#define R_FLG register_flags +#define R_BP register_bp.I16_reg.x_reg +#define R_SI register_si.I16_reg.x_reg +#define R_DI register_di.I16_reg.x_reg +#define R_FLG register_flags /* special registers */ -#define R_ESP register_sp.I32_reg.e_reg -#define R_EBP register_bp.I32_reg.e_reg -#define R_ESI register_si.I32_reg.e_reg -#define R_EDI register_di.I32_reg.e_reg -#define R_EFLG register_flags +#define R_EBP register_bp.I32_reg.e_reg +#define R_ESI register_si.I32_reg.e_reg +#define R_EDI register_di.I32_reg.e_reg +#define R_EFLG register_flags /* segment registers */ -#define R_DS register_ds -#define R_SS register_ss -#define R_ES register_es -#define R_FS register_fs -#define R_GS register_gs - -#define SEG_ADDR(x) (((x) >> 4) & 0x00F000) -#define SEG_OFF(x) ((x) & 0x0FFFF) -#define FARP(x) ((le32toh(x) & 0xffff) + ((le32toh(x) >> 12) & 0xffff00)) +#define R_ES register_es +#define R_FS register_fs +#define R_GS register_gs -#define MAPPED_MEMORY_SIZE (1024 * 1024) -#define PAGE_RESERV (4096 * 5) +#define X86BIOS_PHYSTOSEG(x) (((x) >> 4) & 0xffff) +#define X86BIOS_PHYSTOOFF(x) ((x) & 0x000f) __BEGIN_DECLS -void *x86bios_alloc(int count, int *segs); -void x86bios_free(void *pbuf, int count); -void x86bios_intr(struct x86regs *regs, int intno); -void *x86bios_offset(uint32_t offs); +void *x86bios_alloc(uint32_t *offset, size_t size); +void x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off); +void x86bios_free(void *addr, size_t size); +uint32_t x86bios_get_intr(int intno); +void *x86bios_get_orm(uint32_t offset); +void x86bios_init_regs(struct x86regs *regs); +void x86bios_intr(struct x86regs *regs, int intno); +int x86bios_match_device(uint32_t offset, device_t dev); +void *x86bios_offset(uint32_t offset); __END_DECLS #endif /* !_X86BIOS_H_ */ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Oct 19 20:51:27 2009 (r198250) +++ head/sys/conf/files.amd64 Mon Oct 19 20:58:10 2009 (r198251) @@ -301,6 +301,4 @@ libkern/memset.c standard # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa # compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa -compat/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa -contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Oct 19 20:51:27 2009 (r198250) +++ head/sys/conf/files.i386 Mon Oct 19 20:58:10 2009 (r198251) @@ -385,6 +385,4 @@ i386/xbox/pic16l.s optional xbox # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa # compat/x86bios/x86bios.c optional x86bios | atkbd | dpms | vesa -compat/x86bios/x86bios_alloc.c optional x86bios | atkbd | dpms | vesa contrib/x86emu/x86emu.c optional x86bios | atkbd | dpms | vesa -contrib/x86emu/x86emu_util.c optional x86bios | atkbd | dpms | vesa Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Oct 19 20:51:27 2009 (r198250) +++ head/sys/dev/atkbdc/atkbd.c Mon Oct 19 20:58:10 2009 (r198251) @@ -1091,32 +1091,35 @@ get_typematic(keyboard_t *kbd) { #if defined(__i386__) || defined(__amd64__) /* - * Only some systems allow us to retrieve the keyboard repeat + * Only some systems allow us to retrieve the keyboard repeat * rate previously set via the BIOS... */ x86regs_t regs; uint8_t *p; + if (x86bios_get_intr(0x15) == 0 || x86bios_get_intr(0x16) == 0) + return (ENODEV); + /* Is BIOS system configuration table supported? */ - bzero(®s, sizeof(regs)); + x86bios_init_regs(®s); regs.R_AH = 0xc0; x86bios_intr(®s, 0x15); if ((regs.R_FLG & PSL_C) != 0 || regs.R_AH != 0) return (ENODEV); - /* Is int 16, function 0x09 supported? */ + /* Is int 0x16, function 0x09 supported? */ p = x86bios_offset((regs.R_ES << 4) + regs.R_BX); if (readw(p) < 5 || (readb(p + 6) & 0x40) == 0) return (ENODEV); - /* Is int 16, function 0x0306 supported? */ - bzero(®s, sizeof(regs)); + /* Is int 0x16, function 0x0306 supported? */ + x86bios_init_regs(®s); regs.R_AH = 0x09; x86bios_intr(®s, 0x16); if ((regs.R_AL & 0x08) == 0) return (ENODEV); - bzero(®s, sizeof(regs)); + x86bios_init_regs(®s); regs.R_AX = 0x0306; x86bios_intr(®s, 0x16); kbd->kb_delay1 = typematic_delay(regs.R_BH << 5); Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Mon Oct 19 20:51:27 2009 (r198250) +++ head/sys/dev/dpms/dpms.c Mon Oct 19 20:58:10 2009 (r198251) @@ -125,13 +125,13 @@ static void dpms_identify(driver_t *driver, device_t parent) { - /* - * XXX: The DPMS VBE only allows for manipulating a single - * monitor, but we don't know which one. Just attach to the - * first vgapci(4) device we encounter and hope it is the - * right one. - */ - if (devclass_get_device(dpms_devclass, 0) == NULL) + /* The DPMS VBE only allows for manipulating a single monitor. */ + if (devclass_get_device(dpms_devclass, 0) != NULL) + return; + + if ((x86bios_match_device(0xc0000, parent) && + device_get_flags(parent) != 0) || + x86bios_get_orm(0xc0000) != NULL) device_add_child(parent, "dpms", 0); } @@ -172,8 +172,11 @@ dpms_detach(device_t dev) static int dpms_suspend(device_t dev) { + struct dpms_softc *sc; - dpms_set_state(DPMS_OFF); + sc = device_get_softc(dev); + if ((sc->dpms_supported_states & DPMS_OFF) != 0) + dpms_set_state(DPMS_OFF); return (0); } @@ -192,15 +195,16 @@ dpms_call_bios(int subfunction, int *bh) { x86regs_t regs; - bzero(®s, sizeof(regs)); + if (x86bios_get_intr(0x10) == 0) + return (ENXIO); + + x86bios_init_regs(®s); regs.R_AX = VBE_DPMS_FUNCTION; regs.R_BL = subfunction; regs.R_BH = *bh; - regs.R_ES = 0; - regs.R_DI = 0; x86bios_intr(®s, 0x10); - if ((regs.R_EAX & 0xffff) != 0x004f) + if (regs.R_AX != 0x004f) return (ENXIO); *bh = regs.R_BH; Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Mon Oct 19 20:51:27 2009 (r198250) +++ head/sys/dev/fb/vesa.c Mon Oct 19 20:58:10 2009 (r198251) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #ifndef VGA_NO_MODE_CHANGE #include +#include #include #include #include @@ -51,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -160,7 +163,9 @@ static char *vesa_revstr = NULL; #define BIOS_SADDRTOLADDR(p) ((((p) & 0xffff0000) >> 12) + ((p) & 0x0000ffff)) static int int10_set_mode(int mode); +static int vesa_bios_post(void); static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode); +static int vesa_bios_get_current_mode(void); static int vesa_bios_set_mode(int mode); static int vesa_bios_get_dac(void); static int vesa_bios_set_dac(int bits); @@ -222,12 +227,62 @@ int10_set_mode(int mode) { x86regs_t regs; - bzero(®s, sizeof(regs)); - regs.R_EAX = 0x0000 | mode; + x86bios_init_regs(®s); + regs.R_AL = mode; x86bios_intr(®s, 0x10); - return 0; + return (0); +} + +static int +vesa_bios_post(void) +{ + x86regs_t regs; + devclass_t dc; + device_t *devs; + device_t dev; + int count, i, is_pci; + + if (x86bios_get_orm(0xc0000) == NULL) + return (1); + + dev = NULL; + is_pci = 0; + + /* Find the matching PCI video controller. */ + dc = devclass_find("vgapci"); + if (dc != NULL && devclass_get_devices(dc, &devs, &count) == 0) { + for (dev = NULL, i = 0; dev == NULL && i < count; devs++, i++) + if (x86bios_match_device(0xc0000, *devs) && + device_get_flags(*devs) != 0) { + dev = *devs; + is_pci = 1; + break; + } + free(devs, M_TEMP); + } + + /* Try VGA if a PCI device is not found. */ + if (dev == NULL) { + dc = devclass_find(VGA_DRIVER_NAME); + if (dc != NULL) + dev = devclass_get_device(dc, 0); + } + + if (bootverbose) + printf("%s: calling BIOS POST\n", + dev == NULL ? "VESA" : device_get_nameunit(dev)); + + x86bios_init_regs(®s); + if (is_pci) { + regs.R_AH = pci_get_bus(dev); + regs.R_AL = (pci_get_slot(dev) << 3) | + (pci_get_function(dev) & 0x07); + } + regs.R_DL = 0x80; + x86bios_call(®s, 0xc000, 0x0003); + return (0); } /* VESA BIOS calls */ @@ -235,30 +290,47 @@ static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode) { x86regs_t regs; - int offs; - u_char *buf; + uint32_t offs; + void *buf; - bzero(®s, sizeof(regs)); - regs.R_EAX = 0x4f01; - regs.R_ECX = mode; + buf = x86bios_alloc(&offs, sizeof(*vmode)); + if (buf == NULL) + return (1); - buf = (u_char *)x86bios_alloc(1, &offs); + x86bios_init_regs(®s); + regs.R_AX = 0x4f01; + regs.R_CX = mode; - regs.R_ES = SEG_ADDR(offs); - regs.R_DI = SEG_OFF(offs); + regs.R_ES = X86BIOS_PHYSTOSEG(offs); + regs.R_DI = X86BIOS_PHYSTOOFF(offs); x86bios_intr(®s, 0x10); - if ((regs.R_AX & 0xff) != 0x4f) - { - x86bios_free(buf, 1); - return 1; + if (regs.R_AX != 0x004f) { + x86bios_free(buf, sizeof(*vmode)); + return (1); } bcopy(buf, vmode, sizeof(*vmode)); - x86bios_free(buf, 1); + x86bios_free(buf, sizeof(*vmode)); - return 0; + return (0); +} + +static int +vesa_bios_get_current_mode(void) +{ + x86regs_t regs; + + x86bios_init_regs(®s); + regs.R_AX = 0x4f03; + + x86bios_intr(®s, 0x10); + + if (regs.R_AX != 0x004f) + return (-1); + + return (regs.R_BX); } static int @@ -266,13 +338,13 @@ vesa_bios_set_mode(int mode) { x86regs_t regs; - bzero(®s, sizeof(regs)); - regs.R_EAX = 0x4f02; - regs.R_EBX = mode; + x86bios_init_regs(®s); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 21:01:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2290E106568F; Mon, 19 Oct 2009 21:01:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1271C8FC1C; Mon, 19 Oct 2009 21:01:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JL1l1I014917; Mon, 19 Oct 2009 21:01:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JL1k3E014911; Mon, 19 Oct 2009 21:01:46 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200910192101.n9JL1k3E014911@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Oct 2009 21:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198252 - head/sys/compat/x86bios X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 21:01:48 -0000 Author: jkim Date: Mon Oct 19 21:01:42 2009 New Revision: 198252 URL: http://svn.freebsd.org/changeset/base/198252 Log: Fix a copy-and-pasto in the previous commit. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Mon Oct 19 20:58:10 2009 (r198251) +++ head/sys/compat/x86bios/x86bios.c Mon Oct 19 21:01:42 2009 (r198252) @@ -426,7 +426,7 @@ static __inline int x86bios_map_mem(void) { - x86bios_ivt = pmap_mapdev(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE); + x86bios_ivt = pmap_mapbios(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE); if (x86bios_ivt == NULL) return (1); x86bios_rom = pmap_mapdev(X86BIOS_ROM_BASE, X86BIOS_ROM_SIZE); From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 21:24:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1C77106566B; Mon, 19 Oct 2009 21:24:19 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B16C28FC19; Mon, 19 Oct 2009 21:24:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JLOJpL015699; Mon, 19 Oct 2009 21:24:19 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JLOJaP015697; Mon, 19 Oct 2009 21:24:19 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910192124.n9JLOJaP015697@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 19 Oct 2009 21:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198254 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 21:24:19 -0000 Author: edwin Date: Mon Oct 19 21:24:19 2009 New Revision: 198254 URL: http://svn.freebsd.org/changeset/base/198254 Log: When tzsetup is run as non-root and the "CMOS clock question on UTC" is answered as No, it would abort without properly ending the dialog session. MFC after: 1 week Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Mon Oct 19 21:10:56 2009 (r198253) +++ head/usr.sbin/tzsetup/tzsetup.c Mon Oct 19 21:24:19 2009 (r198254) @@ -709,9 +709,11 @@ main(int argc, char **argv) fd = open(_PATH_WALL_CMOS_CLOCK, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IRGRP | S_IROTH); - if (fd < 0) + if (fd < 0) { + end_dialog(); err(1, "create %s", _PATH_WALL_CMOS_CLOCK); + } close(fd); } } From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 21:37:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 300C01065672; Mon, 19 Oct 2009 21:37:32 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5E18FC15; Mon, 19 Oct 2009 21:37:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JLbWw7015995; Mon, 19 Oct 2009 21:37:32 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JLbWIB015993; Mon, 19 Oct 2009 21:37:32 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910192137.n9JLbWIB015993@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 19 Oct 2009 21:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198255 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 21:37:32 -0000 Author: edwin Date: Mon Oct 19 21:37:31 2009 New Revision: 198255 URL: http://svn.freebsd.org/changeset/base/198255 Log: Make the usage of the default zoneinfo file to install clearer. MFC after: 1 week Modified: head/usr.sbin/tzsetup/tzsetup.8 Modified: head/usr.sbin/tzsetup/tzsetup.8 ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.8 Mon Oct 19 21:24:19 2009 (r198254) +++ head/usr.sbin/tzsetup/tzsetup.8 Mon Oct 19 21:37:31 2009 (r198255) @@ -32,7 +32,7 @@ .Sh SYNOPSIS .Nm .Op Fl ns -.Op Ar default +.Op Ar zoneinfo file .Sh DESCRIPTION The .Nm @@ -56,10 +56,11 @@ Skip the initial question about adjustin .Tn UTC . .El .Pp -It is possible to short-circuit the menu system by specifying a -.Ar default -on the command line; this is intended mainly for pre-configured -installation scripts. +It is possible to short-circuit the menu system by specifying the +location of a +.Ar zoneinfo file +on the command line; this is intended mainly for pre-configured installation +scripts. .Sh TIMEZONE DATABASE The contents of the timezone database are indexed by .Pa /usr/share/zoneinfo/zone.tab . From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 21:44:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13FCC106566B; Mon, 19 Oct 2009 21:44:00 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD10B8FC19; Mon, 19 Oct 2009 21:43:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JLhxqA016157; Mon, 19 Oct 2009 21:43:59 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JLhxnX016154; Mon, 19 Oct 2009 21:43:59 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910192143.n9JLhxnX016154@svn.freebsd.org> From: Andrew Thompson Date: Mon, 19 Oct 2009 21:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198256 - in head/sys: conf dev/usb/serial modules/usb modules/usb/uch341 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 21:44:00 -0000 Author: thompsa Date: Mon Oct 19 21:43:59 2009 New Revision: 198256 URL: http://svn.freebsd.org/changeset/base/198256 Log: Remove the newly added uch341 driver, it will be merged into uchcom instead. Suggested by: takawata Submitted by: HPS Deleted: head/sys/dev/usb/serial/uch341.c head/sys/modules/usb/uch341/ Modified: head/sys/conf/files head/sys/modules/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 19 21:37:31 2009 (r198255) +++ head/sys/conf/files Mon Oct 19 21:43:59 2009 (r198256) @@ -1645,7 +1645,6 @@ dev/usb/serial/u3g.c optional u3g dev/usb/serial/uark.c optional uark dev/usb/serial/ubsa.c optional ubsa dev/usb/serial/ubser.c optional ubser -dev/usb/serial/uch341.c optional uch341 dev/usb/serial/uchcom.c optional uchcom dev/usb/serial/ucycom.c optional ucycom dev/usb/serial/ufoma.c optional ufoma @@ -1661,7 +1660,7 @@ dev/usb/serial/uslcom.c optional uslcom dev/usb/serial/uvisor.c optional uvisor dev/usb/serial/uvscom.c optional uvscom dev/usb/serial/usb_serial.c optional ucom | \ - (u3g | uark | ubsa | ubser | uch341 | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) + (u3g | uark | ubsa | ubser | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) # # USB misc drivers # Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Oct 19 21:37:31 2009 (r198255) +++ head/sys/modules/usb/Makefile Mon Oct 19 21:43:59 2009 (r198256) @@ -29,8 +29,8 @@ SUBDIR = usb SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} SUBDIR += rum uath upgt ural zyd ${_urtw} SUBDIR += uhid ukbd ums udbp ufm -SUBDIR += ucom u3g uark ubsa ubser uch341 uchcom ucycom ufoma uftdi ugensa \ - uipaq ulpt umct umodem umoscom uplcom uslcom uvisor uvscom +SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ + umct umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe cdce cue kue rue udav SUBDIR += usfs umass urio SUBDIR += quirk template From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 21:52:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 643F81065670; Mon, 19 Oct 2009 21:52:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 525418FC0C; Mon, 19 Oct 2009 21:52:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JLq2kr016358; Mon, 19 Oct 2009 21:52:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JLq2Hn016355; Mon, 19 Oct 2009 21:52:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910192152.n9JLq2Hn016355@svn.freebsd.org> From: Andrew Thompson Date: Mon, 19 Oct 2009 21:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198257 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 21:52:02 -0000 Author: thompsa Date: Mon Oct 19 21:52:02 2009 New Revision: 198257 URL: http://svn.freebsd.org/changeset/base/198257 Log: Add support for newer WinChipHead CH341 chips, previously in the uch341 driver. Submitted by: HPS Modified: head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Mon Oct 19 21:43:59 2009 (r198256) +++ head/sys/dev/usb/serial/uchcom.c Mon Oct 19 21:52:02 2009 (r198257) @@ -66,7 +66,8 @@ __FBSDID("$FreeBSD$"); /* - * driver for WinChipHead CH341/340, the worst USB-serial chip in the world. + * Driver for WinChipHead CH341/340, the worst USB-serial chip in the + * world. */ #include @@ -206,6 +207,7 @@ static const struct uchcom_divider_recor static const struct usb_device_id uchcom_devs[] = { {USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)}, + {USB_VPI(USB_VENDOR_WCH2, USB_PRODUCT_WCH2_CH341SER, 0)}, }; /* protypes */ @@ -213,6 +215,7 @@ static const struct usb_device_id uchcom static int uchcom_pre_param(struct ucom_softc *, struct termios *); static void uchcom_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); +static void uchcom_cfg_open(struct ucom_softc *ucom); static void uchcom_cfg_param(struct ucom_softc *, struct termios *); static void uchcom_cfg_set_break(struct ucom_softc *, uint8_t); static void uchcom_cfg_set_dtr(struct ucom_softc *, uint8_t); @@ -224,12 +227,9 @@ static void uchcom_stop_write(struct uco static void uchcom_update_version(struct uchcom_softc *); static void uchcom_convert_status(struct uchcom_softc *, uint8_t); static void uchcom_update_status(struct uchcom_softc *); -static void uchcom_set_dtrrts(struct uchcom_softc *); +static void uchcom_set_dtr_rts(struct uchcom_softc *); static int uchcom_calc_divider_settings(struct uchcom_divider *, uint32_t); -static void uchcom_set_dte_rate(struct uchcom_softc *, uint32_t); -static void uchcom_set_line_control(struct uchcom_softc *, tcflag_t); -static void uchcom_clear_chip(struct uchcom_softc *); -static void uchcom_reset_chip(struct uchcom_softc *); +static void uchcom_set_baudrate(struct uchcom_softc *, uint32_t); static void uchcom_poll(struct ucom_softc *ucom); static device_probe_t uchcom_probe; @@ -275,6 +275,7 @@ static struct ucom_callback uchcom_callb .ucom_cfg_set_dtr = &uchcom_cfg_set_dtr, .ucom_cfg_set_rts = &uchcom_cfg_set_rts, .ucom_cfg_set_break = &uchcom_cfg_set_break, + .ucom_cfg_open = &uchcom_cfg_open, .ucom_cfg_param = &uchcom_cfg_param, .ucom_pre_param = &uchcom_pre_param, .ucom_start_read = &uchcom_start_read, @@ -341,17 +342,6 @@ uchcom_attach(device_t dev) "error=%s\n", usbd_errstr(error)); goto detach; } - /* - * Do the initialization during attach so that the system does not - * sleep during open: - */ - uchcom_update_version(sc); - uchcom_clear_chip(sc); - uchcom_reset_chip(sc); - uchcom_update_status(sc); - - sc->sc_dtr = 1; - sc->sc_rts = 1; /* clear stall at first run */ mtx_lock(&sc->sc_mtx); @@ -458,8 +448,7 @@ uchcom_get_version(struct uchcom_softc * { uint8_t buf[UCHCOM_INPUT_BUF_SIZE]; - uchcom_ctrl_read( - sc, UCHCOM_REQ_GET_VERSION, 0, 0, buf, sizeof(buf)); + uchcom_ctrl_read(sc, UCHCOM_REQ_GET_VERSION, 0, 0, buf, sizeof(buf)); if (rver) *rver = buf[0]; @@ -472,13 +461,13 @@ uchcom_get_status(struct uchcom_softc *s } static void -uchcom_set_dtrrts_10(struct uchcom_softc *sc, uint8_t val) +uchcom_set_dtr_rts_10(struct uchcom_softc *sc, uint8_t val) { uchcom_write_reg(sc, UCHCOM_REG_STAT1, val, UCHCOM_REG_STAT1, val); } static void -uchcom_set_dtrrts_20(struct uchcom_softc *sc, uint8_t val) +uchcom_set_dtr_rts_20(struct uchcom_softc *sc, uint8_t val) { uchcom_ctrl_write(sc, UCHCOM_REQ_SET_DTRRTS, val, 0); } @@ -515,7 +504,7 @@ uchcom_update_status(struct uchcom_softc static void -uchcom_set_dtrrts(struct uchcom_softc *sc) +uchcom_set_dtr_rts(struct uchcom_softc *sc) { uint8_t val = 0; @@ -525,9 +514,9 @@ uchcom_set_dtrrts(struct uchcom_softc *s val |= UCHCOM_RTS_MASK; if (sc->sc_version < UCHCOM_VER_20) - uchcom_set_dtrrts_10(sc, ~val); + uchcom_set_dtr_rts_10(sc, ~val); else - uchcom_set_dtrrts_20(sc, ~val); + uchcom_set_dtr_rts_20(sc, ~val); } static void @@ -583,16 +572,16 @@ found: dp->dv_div = (uint8_t)-div; } - mod = UCHCOM_BPS_MOD_BASE / rate + UCHCOM_BPS_MOD_BASE_OFS; - mod = mod + mod / 2; + mod = (UCHCOM_BPS_MOD_BASE / rate) + UCHCOM_BPS_MOD_BASE_OFS; + mod = mod + (mod / 2); - dp->dv_mod = mod / 0x100; + dp->dv_mod = (mod + 0xFF) / 0x100; return (0); } static void -uchcom_set_dte_rate(struct uchcom_softc *sc, uint32_t rate) +uchcom_set_baudrate(struct uchcom_softc *sc, uint32_t rate) { struct uchcom_divider dv; @@ -607,76 +596,6 @@ uchcom_set_dte_rate(struct uchcom_softc UCHCOM_REG_BPS_PAD, 0); } -static void -uchcom_set_line_control(struct uchcom_softc *sc, tcflag_t cflag) -{ - uint8_t lcr1 = 0; - uint8_t lcr2 = 0; - - uchcom_read_reg(sc, UCHCOM_REG_LCR1, &lcr1, UCHCOM_REG_LCR2, &lcr2); - - lcr1 &= ~UCHCOM_LCR1_MASK; - lcr2 &= ~UCHCOM_LCR2_MASK; - - /* - * XXX: it is difficult to handle the line control appropriately: - * - CS8, !CSTOPB and any parity mode seems ok, but - * - the chip doesn't have the function to calculate parity - * in !CS8 mode. - * - it is unclear that the chip supports CS5,6 mode. - * - it is unclear how to handle stop bits. - */ - - if (cflag & PARENB) { - lcr1 |= UCHCOM_LCR1_PARENB; - if (cflag & PARODD) - lcr2 |= UCHCOM_LCR2_PARODD; - else - lcr2 |= UCHCOM_LCR2_PAREVEN; - } - uchcom_write_reg(sc, UCHCOM_REG_LCR1, lcr1, UCHCOM_REG_LCR2, lcr2); -} - -static void -uchcom_clear_chip(struct uchcom_softc *sc) -{ - DPRINTF("\n"); - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); -} - -static void -uchcom_reset_chip(struct uchcom_softc *sc) -{ - uint16_t val; - uint16_t idx; - uint8_t lcr1; - uint8_t lcr2; - uint8_t pre; - uint8_t div; - uint8_t mod; - - uchcom_read_reg(sc, UCHCOM_REG_LCR1, &lcr1, UCHCOM_REG_LCR2, &lcr2); - uchcom_read_reg(sc, UCHCOM_REG_BPS_PRE, &pre, UCHCOM_REG_BPS_DIV, &div); - uchcom_read_reg(sc, UCHCOM_REG_BPS_MOD, &mod, UCHCOM_REG_BPS_PAD, NULL); - - val = 0; - idx = 0; - val |= (uint16_t)(lcr1 & 0xF0) << 8; - val |= 0x01; - val |= (uint16_t)(lcr2 & 0x0F) << 8; - val |= 0x02; - idx |= pre & 0x07; - val |= 0x04; - idx |= (uint16_t)div << 8; - val |= 0x08; - idx |= mod & 0xF8; - val |= 0x10; - - DPRINTF("reset v=0x%04X, i=0x%04X\n", val, idx); - - uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, val, idx); -} - /* ---------------------------------------------------------------------- * methods for ucom */ @@ -699,7 +618,7 @@ uchcom_cfg_set_dtr(struct ucom_softc *uc DPRINTF("onoff = %d\n", onoff); sc->sc_dtr = onoff; - uchcom_set_dtrrts(sc); + uchcom_set_dtr_rts(sc); } static void @@ -710,7 +629,18 @@ uchcom_cfg_set_rts(struct ucom_softc *uc DPRINTF("onoff = %d\n", onoff); sc->sc_rts = onoff; - uchcom_set_dtrrts(sc); + uchcom_set_dtr_rts(sc); +} + +static void +uchcom_cfg_open(struct ucom_softc *ucom) +{ + struct uchcom_softc *sc = ucom->sc_parent; + + DPRINTF("\n"); + + uchcom_update_version(sc); + uchcom_update_status(sc); } static int @@ -719,12 +649,10 @@ uchcom_pre_param(struct ucom_softc *ucom struct uchcom_divider dv; switch (t->c_cflag & CSIZE) { - case CS5: - case CS6: - case CS7: - return (EIO); - default: + case CS8: break; + default: + return (EIO); } if (uchcom_calc_divider_settings(&dv, t->c_ospeed)) { @@ -738,8 +666,16 @@ uchcom_cfg_param(struct ucom_softc *ucom { struct uchcom_softc *sc = ucom->sc_parent; - uchcom_set_line_control(sc, t->c_cflag); - uchcom_set_dte_rate(sc, t->c_ospeed); + uchcom_get_version(sc, 0); + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0, 0); + uchcom_set_baudrate(sc, t->c_ospeed); + uchcom_read_reg(sc, 0x18, 0, 0x25, 0); + uchcom_write_reg(sc, 0x18, 0x50, 0x25, 0x00); + uchcom_update_status(sc); + uchcom_ctrl_write(sc, UCHCOM_REQ_RESET, 0x501f, 0xd90a); + uchcom_set_baudrate(sc, t->c_ospeed); + uchcom_set_dtr_rts(sc); + uchcom_update_status(sc); } static void @@ -840,14 +776,14 @@ uchcom_write_callback(struct usb_xfer *x tr_setup: pc = usbd_xfer_get_frame(xfer, 0); if (ucom_get_data(&sc->sc_ucom, pc, 0, - UCHCOM_BULK_BUF_SIZE, &actlen)) { + usbd_xfer_max_len(xfer), &actlen)) { DPRINTF("actlen = %d\n", actlen); usbd_xfer_set_frame_len(xfer, 0, actlen); usbd_transfer_submit(xfer); } - return; + break; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -855,8 +791,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - return; - + break; } } @@ -871,14 +806,17 @@ uchcom_read_callback(struct usb_xfer *xf switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - pc = usbd_xfer_get_frame(xfer, 0); - ucom_put_data(&sc->sc_ucom, pc, 0, actlen); + + if (actlen > 0) { + pc = usbd_xfer_get_frame(xfer, 0); + ucom_put_data(&sc->sc_ucom, pc, 0, actlen); + } case USB_ST_SETUP: tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); - return; + break; default: /* Error */ if (error != USB_ERR_CANCELLED) { @@ -886,7 +824,7 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - return; + break; } } Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Oct 19 21:43:59 2009 (r198256) +++ head/sys/dev/usb/usbdevs Mon Oct 19 21:52:02 2009 (r198257) @@ -626,6 +626,7 @@ vendor AMIT 0x18c5 AMIT vendor QCOM 0x18e8 Qcom vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless vendor MPMAN 0x1cae MpMan vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik @@ -2516,8 +2517,11 @@ product WACOM GRAPHIRE 0x0010 Graphire product WACOM GRAPHIRE3_4X5 0x0013 Graphire 3 4x5 product WACOM INTUOSA5 0x0021 Intuos A5 product WACOM GD0912U 0x0022 Intuos 9x12 Graphics Tablet -/* WCH products*/ + +/* WCH products */ product WCH CH341SER 0x5523 CH341/CH340 USB-Serial Bridge +product WCH2 CH341SER 0x7523 CH341/CH340 USB-Serial Bridge + /* Western Digital products */ product WESTERN COMBO 0x0200 Firewire USB Combo product WESTERN EXTHDD 0x0400 External HDD From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 21:54:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26B1E106568D; Mon, 19 Oct 2009 21:54:42 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15D6B8FC29; Mon, 19 Oct 2009 21:54:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JLsfqL016442; Mon, 19 Oct 2009 21:54:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JLsf00016440; Mon, 19 Oct 2009 21:54:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910192154.n9JLsf00016440@svn.freebsd.org> From: Andrew Thompson Date: Mon, 19 Oct 2009 21:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198258 - head/sys/modules/usb/ucom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 21:54:42 -0000 Author: thompsa Date: Mon Oct 19 21:54:41 2009 New Revision: 198258 URL: http://svn.freebsd.org/changeset/base/198258 Log: Add opt_gdb.h which is now needed by ucom. Modified: head/sys/modules/usb/ucom/Makefile Modified: head/sys/modules/usb/ucom/Makefile ============================================================================== --- head/sys/modules/usb/ucom/Makefile Mon Oct 19 21:52:02 2009 (r198257) +++ head/sys/modules/usb/ucom/Makefile Mon Oct 19 21:54:41 2009 (r198258) @@ -30,7 +30,7 @@ S= ${.CURDIR}/../../.. .PATH: $S/dev/usb/serial KMOD= ucom -SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ +SRCS= opt_bus.h opt_usb.h opt_gdb.h device_if.h bus_if.h usb_if.h usbdevs.h \ usb_serial.c .include From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 23:09:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 546F6106568B; Mon, 19 Oct 2009 23:09:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 431EA8FC1B; Mon, 19 Oct 2009 23:09:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JN9d8m023242; Mon, 19 Oct 2009 23:09:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JN9doS023240; Mon, 19 Oct 2009 23:09:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200910192309.n9JN9doS023240@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Oct 2009 23:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198259 - head/sys/dev/dpms X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 23:09:39 -0000 Author: jkim Date: Mon Oct 19 23:09:39 2009 New Revision: 198259 URL: http://svn.freebsd.org/changeset/base/198259 Log: Remove a redundant option ROM check, which was never meant to be committed. Modified: head/sys/dev/dpms/dpms.c Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Mon Oct 19 21:54:41 2009 (r198258) +++ head/sys/dev/dpms/dpms.c Mon Oct 19 23:09:39 2009 (r198259) @@ -129,9 +129,8 @@ dpms_identify(driver_t *driver, device_t if (devclass_get_device(dpms_devclass, 0) != NULL) return; - if ((x86bios_match_device(0xc0000, parent) && - device_get_flags(parent) != 0) || - x86bios_get_orm(0xc0000) != NULL) + if (x86bios_match_device(0xc0000, parent) && + device_get_flags(parent) != 0) device_add_child(parent, "dpms", 0); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 23:11:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5342F106566B; Mon, 19 Oct 2009 23:11:44 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41D948FC0C; Mon, 19 Oct 2009 23:11:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JNBial023527; Mon, 19 Oct 2009 23:11:44 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JNBiQ1023525; Mon, 19 Oct 2009 23:11:44 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910192311.n9JNBiQ1023525@svn.freebsd.org> From: Rui Paulo Date: Mon, 19 Oct 2009 23:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198260 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 23:11:44 -0000 Author: rpaulo Date: Mon Oct 19 23:11:43 2009 New Revision: 198260 URL: http://svn.freebsd.org/changeset/base/198260 Log: Fix a bug in composing PERR frames introduced by latest draft update. MFC after: 3 days Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Mon Oct 19 23:09:39 2009 (r198259) +++ head/sys/net80211/ieee80211_hwmp.c Mon Oct 19 23:11:43 2009 (r198260) @@ -548,7 +548,7 @@ hwmp_add_meshperr(uint8_t *frm, const st *frm++ = perr->perr_ttl; *frm++ = perr->perr_ndests; for (i = 0; i < perr->perr_ndests; i++) { - *frm += perr->perr_dests[i].dest_flags; + *frm++ = perr->perr_dests[i].dest_flags; IEEE80211_ADDR_COPY(frm, perr->perr_dests[i].dest_addr); frm += 6; ADDWORD(frm, perr->perr_dests[i].dest_seq); @@ -1114,6 +1114,7 @@ hwmp_peerdown(struct ieee80211_node *ni) "%s", "delete route entry"); perr.perr_ttl = ms->ms_ttl; perr.perr_ndests = 1; + PERR_DFLAGS(0) = 0; if (hr->hr_seq == 0) PERR_DFLAGS(0) |= IEEE80211_MESHPERR_DFLAGS_USN; PERR_DFLAGS(0) |= IEEE80211_MESHPERR_DFLAGS_RC; From owner-svn-src-head@FreeBSD.ORG Tue Oct 20 02:35:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99BFC106566C; Tue, 20 Oct 2009 02:35:12 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87DE08FC08; Tue, 20 Oct 2009 02:35:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9K2ZCMu040678; Tue, 20 Oct 2009 02:35:12 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9K2ZCEU040673; Tue, 20 Oct 2009 02:35:12 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200910200235.n9K2ZCEU040673@svn.freebsd.org> From: Alexander Kabaev Date: Tue, 20 Oct 2009 02:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198262 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 02:35:12 -0000 Author: kan Date: Tue Oct 20 02:35:12 2009 New Revision: 198262 URL: http://svn.freebsd.org/changeset/base/198262 Log: Use callout_init_mtx on FreeBSD versions recent enough. This closes the race where interrupt thread can complete the request for which timeout has fired and while mpt_timeout has blocked on mpt_lock. Do a best effort to keep 4.x ang Giant-locked configurartions compiling still. Reported by: ups Reviewed by: scottl Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_raid.c Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Tue Oct 20 00:36:15 2009 (r198261) +++ head/sys/dev/mpt/mpt.c Tue Oct 20 02:35:12 2009 (r198262) @@ -1238,7 +1238,6 @@ retry: req->state = REQ_STATE_ALLOCATED; req->chain = NULL; mpt_assign_serno(mpt, req); - mpt_callout_init(&req->callout); } else if (sleep_ok != 0) { mpt->getreqwaiter = 1; mpt_sleep(mpt, &mpt->request_free_list, PUSER, "mptgreq", 0); @@ -2251,6 +2250,7 @@ mpt_core_attach(struct mpt_softc *mpt) for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { request_t *req = &mpt->request_pool[val]; req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); mpt_free_request(mpt, req); } MPT_UNLOCK(mpt); @@ -2334,10 +2334,18 @@ mpt_core_shutdown(struct mpt_softc *mpt) void mpt_core_detach(struct mpt_softc *mpt) { + int val; + /* * XXX: FREE MEMORY */ mpt_disable_ints(mpt); + + /* Make sure no request has pending timeouts. */ + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + mpt_callout_drain(mpt, &req->callout); + } } int Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Tue Oct 20 00:36:15 2009 (r198261) +++ head/sys/dev/mpt/mpt.h Tue Oct 20 02:35:12 2009 (r198262) @@ -296,13 +296,6 @@ void mpt_map_rquest(void *, bus_dma_segm kthread_exit(status) #endif -/****************************** Timer Facilities ******************************/ -#if __FreeBSD_version > 500000 -#define mpt_callout_init(c) callout_init(c, /*mpsafe*/1); -#else -#define mpt_callout_init(c) callout_init(c); -#endif - /********************************** Endianess *********************************/ #define MPT_2_HOST64(ptr, tag) ptr->tag = le64toh(ptr->tag) #define MPT_2_HOST32(ptr, tag) ptr->tag = le32toh(ptr->tag) @@ -889,6 +882,10 @@ mpt_sleep(struct mpt_softc *mpt, void *i callout_reset(&(req)->callout, (ticks), (func), (arg)); #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c) +#define mpt_callout_drain(mpt, c) \ + callout_stop(c) #else #if 1 @@ -911,9 +908,13 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); + callout_reset(&(req)->callout, (ticks), (func), (arg)) #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init_mtx(c, &(mpt)->mpt_lock, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) #else @@ -926,18 +927,18 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define MPTLOCK_2_CAMLOCK(mpt) #define CAMLOCK_2_MPTLOCK(mpt) +#define mpt_req_timeout(req, ticks, func, arg) \ + callout_reset(&(req)->callout, (ticks), (func), (arg)) +#define mpt_req_untimeout(req, func, arg) \ + callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) + static __inline int mpt_sleep(struct mpt_softc *, void *, int, const char *, int); -#define mpt_ccb_timeout(ccb, ticks, func, arg) \ - do { \ - (ccb)->ccb_h.timeout_ch = timeout((func), (arg), (ticks)); \ - } while (0) -#define mpt_ccb_untimeout(ccb, func, arg) \ - untimeout((func), (arg), (ccb)->ccb_h.timeout_ch) -#define mpt_ccb_timeout_init(ccb) \ - callout_handle_init(&(ccb)->ccb_h.timeout_ch) - static __inline int mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) { Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Tue Oct 20 00:36:15 2009 (r198261) +++ head/sys/dev/mpt/mpt_cam.c Tue Oct 20 02:35:12 2009 (r198262) @@ -1245,7 +1245,10 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, req->serno, ccb, req->ccb); @@ -1256,7 +1259,9 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } /* Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Tue Oct 20 00:36:15 2009 (r198261) +++ head/sys/dev/mpt/mpt_raid.c Tue Oct 20 02:35:12 2009 (r198262) @@ -271,7 +271,7 @@ mpt_raid_attach(struct mpt_softc *mpt) mpt_handler_t handler; int error; - mpt_callout_init(&mpt->raid_timer); + mpt_callout_init(mpt, &mpt->raid_timer); error = mpt_spawn_raid_thread(mpt); if (error != 0) { @@ -320,10 +320,10 @@ mpt_raid_detach(struct mpt_softc *mpt) struct ccb_setasync csa; mpt_handler_t handler; - callout_stop(&mpt->raid_timer); + mpt_callout_drain(mpt, &mpt->raid_timer); + MPT_LOCK(mpt); mpt_terminate_raid_thread(mpt); - handler.reply_handler = mpt_raid_reply_handler; mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler, raid_handler_id); @@ -1570,9 +1570,14 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } void From owner-svn-src-head@FreeBSD.ORG Tue Oct 20 06:54:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C4FA106566B; Tue, 20 Oct 2009 06:54:32 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0808FC12; Tue, 20 Oct 2009 06:54:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9K6sVe0058781; Tue, 20 Oct 2009 06:54:31 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9K6sV0l058778; Tue, 20 Oct 2009 06:54:31 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910200654.n9K6sV0l058778@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 20 Oct 2009 06:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198267 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 06:54:32 -0000 Author: edwin Date: Tue Oct 20 06:54:31 2009 New Revision: 198267 URL: http://svn.freebsd.org/changeset/base/198267 Log: Instead of having to know which timezone was picked last time, you now can run "tzsetup -r" which will reinstall the last choice. This data is recorded in /var/db/zoneinfo. MFC after: 1 week Modified: head/usr.sbin/tzsetup/tzsetup.8 head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.8 ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.8 Tue Oct 20 05:40:51 2009 (r198266) +++ head/usr.sbin/tzsetup/tzsetup.8 Tue Oct 20 06:54:31 2009 (r198267) @@ -31,7 +31,7 @@ .Nd set local timezone .Sh SYNOPSIS .Nm -.Op Fl ns +.Op Fl nrs .Op Ar zoneinfo file .Sh DESCRIPTION The @@ -51,6 +51,9 @@ The following option is available: .Bl -tag -offset indent -width Fl .It Fl n Do not create or copy files. +.It Fl r +Reinstall the zoneinfo file installed last time. The name is obtained from +.Pa /var/db/zoneinfo . .It Fl s Skip the initial question about adjusting the clock if not set to .Tn UTC . @@ -106,6 +109,8 @@ mapping of directory for zoneinfo files .It Pa /usr/share/zoneinfo/zone.tab mapping of timezone file to country and location +.It Pa /var/db/zoneinfo +saved name of the timezone file installed last. .El .Sh SEE ALSO .Xr date 1 , Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Tue Oct 20 05:40:51 2009 (r198266) +++ head/usr.sbin/tzsetup/tzsetup.c Tue Oct 20 06:54:31 2009 (r198267) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -52,9 +53,11 @@ __FBSDID("$FreeBSD$"); #define _PATH_ISO3166 "/usr/share/misc/iso3166" #define _PATH_ZONEINFO "/usr/share/zoneinfo" #define _PATH_LOCALTIME "/etc/localtime" +#define _PATH_DB "/var/db/zoneinfo" #define _PATH_WALL_CMOS_CLOCK "/etc/wall_cmos_clock" static int reallydoit = 1; +static int reinstall = 0; static void usage(void); static int continent_country_menu(dialogMenuItem *); @@ -495,13 +498,14 @@ set_zone_menu(dialogMenuItem *dmi) } static int -install_zone_file(const char *filename) +install_zone_file(const char *filename, int usedialog) { char buf[1024]; char title[64], prompt[64]; struct stat sb; ssize_t len; int fd1, fd2, copymode; + FILE *f; if (lstat(_PATH_LOCALTIME, &sb) < 0) { /* Nothing there yet... */ @@ -519,7 +523,10 @@ install_zone_file(const char *filename) snprintf(prompt, sizeof(prompt), "Creating symbolic link " _PATH_LOCALTIME " to %s", filename); - dialog_notify(prompt); + if (usedialog) + dialog_notify(prompt); + else + fprintf(stderr, "%s\n", prompt); #endif if (reallydoit) { @@ -530,7 +537,10 @@ install_zone_file(const char *filename) snprintf(prompt, sizeof(prompt), "Could not open %s: %s", filename, strerror(errno)); - dialog_mesgbox(title, prompt, 8, 72); + if (usedialog) + dialog_mesgbox(title, prompt, 8, 72); + else + fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -542,7 +552,10 @@ install_zone_file(const char *filename) snprintf(prompt, sizeof(prompt), "Could not open " _PATH_LOCALTIME ": %s", strerror(errno)); - dialog_mesgbox(title, prompt, 8, 72); + if (usedialog) + dialog_mesgbox(title, prompt, 8, 72); + else + fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -554,7 +567,10 @@ install_zone_file(const char *filename) snprintf(prompt, sizeof(prompt), "Error copying %s to " _PATH_LOCALTIME ": %s", filename, strerror(errno)); - dialog_mesgbox(title, prompt, 8, 72); + if (usedialog) + dialog_mesgbox(title, prompt, 8, 72); + else + fprintf(stderr, "%s\n", prompt); /* Better to leave none than a corrupt one. */ unlink(_PATH_LOCALTIME); return (DITEM_FAILURE | DITEM_RECREATE); @@ -567,7 +583,10 @@ install_zone_file(const char *filename) snprintf(prompt, sizeof(prompt), "Cannot access %s: %s", filename, strerror(errno)); - dialog_mesgbox(title, prompt, 8, 72); + if (usedialog) + dialog_mesgbox(title, prompt, 8, 72); + else + fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } unlink(_PATH_LOCALTIME); @@ -577,7 +596,10 @@ install_zone_file(const char *filename) "Cannot create symbolic link " _PATH_LOCALTIME " to %s: %s", filename, strerror(errno)); - dialog_mesgbox(title, prompt, 8, 72); + if (usedialog) + dialog_mesgbox(title, prompt, 8, 72); + else + fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } } @@ -592,8 +614,18 @@ install_zone_file(const char *filename) else snprintf(prompt, sizeof(prompt), "Created symbolic link from " _PATH_LOCALTIME " to %s", filename); - dialog_mesgbox(title, prompt, 8, 72); + if (usedialog) + dialog_mesgbox(title, prompt, 8, 72); + else + fprintf(stderr, "%s\n", prompt); #endif + + /* Save knowledge for later */ + if ((f = fopen(_PATH_DB, "w")) != NULL) { + fprintf(f, "%s\n", filename + strlen(_PATH_ZONEINFO) + 1); + fclose(f); + } + return (DITEM_LEAVE_MENU); } @@ -627,7 +659,7 @@ set_zone_multi(dialogMenuItem *dmi) return (DITEM_FAILURE | DITEM_RECREATE); asprintf(&fn, "%s/%s", _PATH_ZONEINFO, zp->filename); - rv = install_zone_file(fn); + rv = install_zone_file(fn, 1); free(fn); return (rv); } @@ -643,7 +675,7 @@ set_zone_whole_country(dialogMenuItem *d return (DITEM_FAILURE | DITEM_RECREATE); asprintf(&fn, "%s/%s", _PATH_ZONEINFO, cp->filename); - rv = install_zone_file(fn); + rv = install_zone_file(fn, 1); free(fn); return (rv); } @@ -652,7 +684,7 @@ static void usage(void) { - fprintf(stderr, "usage: tzsetup [-ns]\n"); + fprintf(stderr, "usage: tzsetup [-nrs] [zoneinfo file]\n"); exit(1); } @@ -666,14 +698,17 @@ int main(int argc, char **argv) { char title[64], prompt[128]; - int c, fd, skiputc; + int c, fd, rv, skiputc; skiputc = 0; - while ((c = getopt(argc, argv, "ns")) != -1) { + while ((c = getopt(argc, argv, "nrs")) != -1) { switch(c) { case 'n': reallydoit = 0; break; + case 'r': + reinstall = 1; + break; case 's': skiputc = 1; break; @@ -693,6 +728,30 @@ main(int argc, char **argv) sort_countries(); make_menus(); + if (reinstall == 1) { + FILE *f; + char zonefile[MAXPATHLEN]; + + sprintf(zonefile, "%s/", _PATH_ZONEINFO); + if ((f = fopen(_PATH_DB, "r")) != NULL) { + if (fgets(zonefile + strlen(zonefile), + sizeof(zonefile) - strlen(zonefile), f) != NULL) { + zonefile[sizeof(zonefile) - 1] = 0; + if (strlen(zonefile) > 0) { + zonefile[strlen(zonefile) - 1] = 0; + rv = install_zone_file(zonefile, 0); + exit(rv & ~DITEM_LEAVE_MENU); + } + errx(1, "Error reading %s.\n", _PATH_DB); + } + fclose(f); + errx(1, + "Unable to determine earlier installed zoneinfo " + "file. Check %s", _PATH_DB); + } + errx(1, "Cannot open %s for reading. Does it exist?", _PATH_DB); + } + init_dialog(); if (skiputc == 0) { snprintf(title, sizeof(title), @@ -724,10 +783,10 @@ main(int argc, char **argv) snprintf(prompt, sizeof(prompt), "\nUse the default `%s' zone?", argv[optind]); if (!dialog_yesno(title, prompt, 7, 72)) { - install_zone_file(argv[optind]); + rv = install_zone_file(argv[optind], 1); dialog_clear(); end_dialog(); - return (0); + exit(rv & ~DITEM_LEAVE_MENU); } dialog_clear_norefresh(); } From owner-svn-src-head@FreeBSD.ORG Tue Oct 20 07:03:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECB831065670; Tue, 20 Oct 2009 07:03:06 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D15A98FC16; Tue, 20 Oct 2009 07:03:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9K736mT059162; Tue, 20 Oct 2009 07:03:06 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9K736Yh059159; Tue, 20 Oct 2009 07:03:06 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910200703.n9K736Yh059159@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 20 Oct 2009 07:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198270 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 07:03:07 -0000 Author: edwin Date: Tue Oct 20 07:03:06 2009 New Revision: 198270 URL: http://svn.freebsd.org/changeset/base/198270 Log: MFV of tzdata2009o: - Somoa has not moved to DST this year (comment only) - Bangladesh stays on DST for now. - Pakistan went back to standard time in 1 October 2009 MFC after: 1 week Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/asia head/share/zoneinfo/australasia Modified: head/share/zoneinfo/asia ============================================================================== --- head/share/zoneinfo/asia Tue Oct 20 07:00:56 2009 (r198269) +++ head/share/zoneinfo/asia Tue Oct 20 07:03:06 2009 (r198270) @@ -1,5 +1,5 @@ #
-# @(#)asia	8.41
+# @(#)asia	8.42
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -172,11 +172,30 @@ Zone	Asia/Bahrain	3:22:20 -	LMT	1920		# 
 #
 # No DST end date has been announced yet.
 
-# From Arthur David Olson (2009-07-11):
-# Arbitrarily end DST at the end of 2009 so that a POSIX-sytle time zone string
-# can appear in the Dhaka binary file and for the benefit of old glibc
-# reimplementations of the time zone software that mishandle permanent DST.
-# A change will be required once the end date is known.
+# From Alexander Krivenyshev (2009-09-25):
+# Bangladesh won't go back to Standard Time from October 1, 2009, 
+# instead it will continue DST measure till the cabinet makes a fresh decision. 
+#
+# Following report by same newspaper-"The Daily Star Friday":
+# "DST change awaits cabinet decision-Clock won't go back by 1-hr from Oct 1"
+# 
+# http://www.thedailystar.net/newDesign/news-details.php?nid=107021
+# 
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html
+# 
+
+# From Steffen Thorsen (2009-10-13):
+# IANS (Indo-Asian News Service) now reports:
+# Bangladesh has decided that the clock advanced by an hour to make 
+# maximum use of daylight hours as an energy saving measure would 
+# "continue for an indefinite period."
+#
+# One of many places where it is published:
+# 
+# http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html
+# 
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
@@ -186,8 +205,7 @@ Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			6:30	-	BURT	1951 Sep 30
 			6:00	-	DACT	1971 Mar 26 # Dacca Time
 			6:00	-	BDT	2009 Jun 19 23:00 # Bangladesh Time
-			6:00	1:00	BDST	2010
-			6:00	-	BDT
+			6:00	1:00	BDST
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1684,13 +1702,56 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # http://www.thenews.com.pk/updates.asp?id=87168
 # 
 
+# From Alexander Krivenyshev (2009-09-28):
+# According to Associated Press Of Pakistan, it is confirmed that
+# Pakistan clocks across the country would be turned back by an hour from October
+# 1, 2009.
+#
+# "Clocks to go back one hour from 1 Oct"
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2
+# 
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm
+# 
+
+# From Steffen Thorsen (2009-09-29):
+# Alexander Krivenyshev wrote:
+# > According to Associated Press Of Pakistan, it is confirmed that
+# > Pakistan clocks across the country would be turned back by an hour from October
+# > 1, 2009.
+#
+# Now they seem to have changed their mind, November 1 is the new date:
+# 
+# http://www.thenews.com.pk/top_story_detail.asp?Id=24742
+# 
+# "The country's clocks will be reversed by one hour on November 1.
+# Officials of Federal Ministry for Interior told this to Geo News on
+# Monday."
+#
+# And more importantly, it seems that these dates will be kept every year:
+# "It has now been decided that clocks will be wound forward by one hour
+# on April 15 and reversed by an hour on November 1 every year without
+# obtaining prior approval, the officials added."
+#
+# We have confirmed this year's end date with both with the Ministry of
+# Water and Power and the Pakistan Electric Power Company:
+# 
+# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
+# 
+
+# From Christoph Goehre (2009-10-01):
+# [T]he German Consulate General in Karachi reported me today that Pakistan
+# will go back to standard time on 1st of November.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	only	-	Oct	1	0:00	0	-
+Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

Modified: head/share/zoneinfo/australasia
==============================================================================
--- head/share/zoneinfo/australasia	Tue Oct 20 07:00:56 2009	(r198269)
+++ head/share/zoneinfo/australasia	Tue Oct 20 07:03:06 2009	(r198270)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.13
+# @(#)australasia	8.14
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -457,6 +457,36 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
 # 
 
+# From Alexander Krivenyshev (2009-10-03):
+# First, my deepest condolences to people of Samoa islands and all families and
+# loved ones around the world who lost their lives in the earthquake and tsunami.
+#
+# Considering the recent devastation on Samoa by earthquake and tsunami and that
+# many government offices/ ministers are closed- not sure if "Daylight Saving
+# Bill 2009" will be implemented in next few days- on October 4, 2009.
+#
+# Here is reply from Consulate-General of Samoa in New Zealand
+# ---------------------------
+# Consul General
+# consulgeneral@samoaconsulate.org.nz
+#
+# Talofa Alexander,
+#
+# Thank you for your sympathy for our country but at this time we have not
+# been informed about the Daylight Savings Time Change.  Most Ministries in
+# Apia are closed or relocating due to weather concerns.
+#
+# When we do find out if they are still proceeding with the time change we
+# will advise you soonest.
+#
+# Kind Regards,
+# Lana
+# for: Consul General
+
+# From Steffen Thorsen (2009-10-05):
+# We have called a hotel in Samoa and asked about local time there - they 
+# are still on standard time.
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 09:31:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4BA701065676;
	Tue, 20 Oct 2009 09:31:58 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B91C8FC27;
	Tue, 20 Oct 2009 09:31:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9K9VwCL061924;
	Tue, 20 Oct 2009 09:31:58 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9K9VwFj061923;
	Tue, 20 Oct 2009 09:31:58 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200910200931.n9K9VwFj061923@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 20 Oct 2009 09:31:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198271 - head/sys/i386/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 09:31:58 -0000

Author: avg
Date: Tue Oct 20 09:31:57 2009
New Revision: 198271
URL: http://svn.freebsd.org/changeset/base/198271

Log:
  add amdtemp to i386 NOTES
  
  essentially this is a MFamd64
  
  Nod from:	rpaulo

Modified:
  head/sys/i386/conf/NOTES

Modified: head/sys/i386/conf/NOTES
==============================================================================
--- head/sys/i386/conf/NOTES	Tue Oct 20 07:03:06 2009	(r198270)
+++ head/sys/i386/conf/NOTES	Tue Oct 20 09:31:57 2009	(r198271)
@@ -792,8 +792,10 @@ device		ichwd
 # Temperature sensors:
 #
 # coretemp: on-die sensor on Intel Core and newer CPUs
+# amdtemp: on-die sensor on AMD K8/K10/K11 CPUs
 #
 device		coretemp
+device		amdtemp
 
 #
 # CPU control pseudo-device. Provides access to MSRs, CPUID info and

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 09:32:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6CA5A1065692;
	Tue, 20 Oct 2009 09:32:22 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5CCCC8FC12;
	Tue, 20 Oct 2009 09:32:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9K9WMbb061975;
	Tue, 20 Oct 2009 09:32:22 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9K9WMT1061973;
	Tue, 20 Oct 2009 09:32:22 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200910200932.n9K9WMT1061973@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 20 Oct 2009 09:32:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198272 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 09:32:22 -0000

Author: avg
Date: Tue Oct 20 09:32:22 2009
New Revision: 198272
URL: http://svn.freebsd.org/changeset/base/198272

Log:
  ichwd.4: remove a stray line
  
  Nod from:	des
  MFC after:	3 days

Modified:
  head/share/man/man4/ichwd.4

Modified: head/share/man/man4/ichwd.4
==============================================================================
--- head/share/man/man4/ichwd.4	Tue Oct 20 09:31:57 2009	(r198271)
+++ head/share/man/man4/ichwd.4	Tue Oct 20 09:32:22 2009	(r198272)
@@ -66,7 +66,6 @@ it believes the WDT is disabled.
 .Sh SEE ALSO
 .Xr watchdog 4 ,
 .Xr watchdog 8 ,
-.Xr watchdogd 8,
 .Xr watchdog 9
 .Rs
 .%T Using the Intel ICH Family Watchdog Timer (WDT)

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 11:54:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BF5131065676;
	Tue, 20 Oct 2009 11:54:06 +0000 (UTC)
	(envelope-from fjoe@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AED848FC08;
	Tue, 20 Oct 2009 11:54:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KBs6cQ066178;
	Tue, 20 Oct 2009 11:54:06 GMT (envelope-from fjoe@svn.freebsd.org)
Received: (from fjoe@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KBs69O066176;
	Tue, 20 Oct 2009 11:54:06 GMT (envelope-from fjoe@svn.freebsd.org)
Message-Id: <200910201154.n9KBs69O066176@svn.freebsd.org>
From: Max Khon 
Date: Tue, 20 Oct 2009 11:54:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198277 - head/sys/tools
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 11:54:06 -0000

Author: fjoe
Date: Tue Oct 20 11:54:06 2009
New Revision: 198277
URL: http://svn.freebsd.org/changeset/base/198277

Log:
  Allow KMOD with hypens and dots.
  
  MFC after:	1 week

Modified:
  head/sys/tools/fw_stub.awk

Modified: head/sys/tools/fw_stub.awk
==============================================================================
--- head/sys/tools/fw_stub.awk	Tue Oct 20 11:52:39 2009	(r198276)
+++ head/sys/tools/fw_stub.awk	Tue Oct 20 11:54:06 2009	(r198277)
@@ -118,6 +118,8 @@ if (!num_files || !opt_m)
 
 cfilename = opt_c;
 ctmpfilename = cfilename ".tmp";
+modname = opt_m;
+gsub(/[-\.]/, "_", modname);
 
 printc("#include \
 #include \
@@ -139,7 +141,7 @@ for (file_i = 0; file_i < num_files; fil
 }
 
 printc("\nstatic int\n"\
-opt_m "_fw_modevent(module_t mod, int type, void *unused)\
+modname "_fw_modevent(module_t mod, int type, void *unused)\
 {\
 	const struct firmware *fp, *parent;\
 	int error;\
@@ -206,14 +208,14 @@ printc("\t\treturn (error);\
 	return (EINVAL);\
 }\
 \
-static moduledata_t " opt_m "_fw_mod = {\
-        \"" opt_m "_fw\",\
-        " opt_m "_fw_modevent,\
+static moduledata_t " modname "_fw_mod = {\
+        \"" modname "_fw\",\
+        " modname "_fw_modevent,\
         0\
 };\
-DECLARE_MODULE(" opt_m "_fw, " opt_m "_fw_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);\
-MODULE_VERSION(" opt_m "_fw, 1);\
-MODULE_DEPEND(" opt_m "_fw, firmware, 1, 1, 1);\
+DECLARE_MODULE(" modname "_fw, " modname "_fw_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);\
+MODULE_VERSION(" modname "_fw, 1);\
+MODULE_DEPEND(" modname "_fw, firmware, 1, 1, 1);\
 ");
 
 if (opt_c)

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 13:22:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 053BE106566C;
	Tue, 20 Oct 2009 13:22:55 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E83D98FC0A;
	Tue, 20 Oct 2009 13:22:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDMsdC067906;
	Tue, 20 Oct 2009 13:22:54 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDMsdK067903;
	Tue, 20 Oct 2009 13:22:54 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200910201322.n9KDMsdK067903@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 20 Oct 2009 13:22:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198279 - in head: share/man/man4 sys/modules
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 13:22:55 -0000

Author: avg
Date: Tue Oct 20 13:22:54 2009
New Revision: 198279
URL: http://svn.freebsd.org/changeset/base/198279

Log:
  minor: fix sorting of some amd* entries in some makefiles
  
  MFC after:	1 week

Modified:
  head/share/man/man4/Makefile
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/Makefile	Tue Oct 20 12:21:36 2009	(r198278)
+++ head/share/man/man4/Makefile	Tue Oct 20 13:22:54 2009	(r198279)
@@ -30,8 +30,8 @@ MAN=	aac.4 \
 	ale.4 \
 	altq.4 \
 	amd.4 \
-	${_amdtemp.4} \
 	${_amdsmb.4} \
+	${_amdtemp.4} \
 	amr.4 \
 	an.4 \
 	arcmsr.4 \

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Tue Oct 20 12:21:36 2009	(r198278)
+++ head/sys/modules/Makefile	Tue Oct 20 13:22:54 2009	(r198279)
@@ -18,10 +18,10 @@ SUBDIR=	${_3dfx} \
 	${_aic} \
 	aic7xxx \
 	aio \
-	${_amd} \
-	${_amdtemp} \
 	alc \
 	ale \
+	${_amd} \
+	${_amdtemp} \
 	amr \
 	${_an} \
 	${_aout} \

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 13:58:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD5B01065670;
	Tue, 20 Oct 2009 13:58:30 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A2CC68FC1D;
	Tue, 20 Oct 2009 13:58:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KDwUJW068966;
	Tue, 20 Oct 2009 13:58:30 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KDwURT068964;
	Tue, 20 Oct 2009 13:58:30 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200910201358.n9KDwURT068964@svn.freebsd.org>
From: Ken Smith 
Date: Tue, 20 Oct 2009 13:58:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198287 - head/release/scripts
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 13:58:30 -0000

Author: kensmith
Date: Tue Oct 20 13:58:30 2009
New Revision: 198287
URL: http://svn.freebsd.org/changeset/base/198287

Log:
  Update package list for 8.0-REL.
  
  Reviewed by:	re@, portmgr@
  MFC after:	1 day

Modified:
  head/release/scripts/package-split.py

Modified: head/release/scripts/package-split.py
==============================================================================
--- head/release/scripts/package-split.py	Tue Oct 20 13:49:34 2009	(r198286)
+++ head/release/scripts/package-split.py	Tue Oct 20 13:58:30 2009	(r198287)
@@ -51,50 +51,53 @@ def disc1_packages():
 	    'misc/freebsd-doc-zh_tw']
 
     if doing_dvd:
-	pkgs.extend(['lang/perl5.8',
-	    'x11/xorg',
-	    'devel/imake',
-	    'emulators/linux_base-fc4',
-	    'x11/gnome2',
-	    'x11/kde4',
-	    'x11-wm/afterstep',
-	    'x11-wm/windowmaker',
-	    'x11-wm/fvwm2',
-	    'archivers/unzip',
+	pkgs.extend(['archivers/unzip',
 	    'astro/xearth',
 	    'devel/gmake',
+	    'devel/imake',
 	    'editors/emacs',
 	    'editors/vim-lite',
+	    'emulators/linux_base-f10',
 	    'emulators/mtools',
 	    'graphics/png',
 	    'graphics/xv',
 	    'irc/xchat',
+	    'lang/perl5.8',
+	    'mail/alpine',
 	    'mail/exim',
 	    'mail/fetchmail',
 	    'mail/mutt',
-	    'mail/alpine',
 	    'mail/popd',
-	    'mail/xfmail',
 	    'mail/postfix',
+	    'mail/xfmail',
 	    'net/cvsup-without-gui',
 	    'net/rsync',
 	    'net/samba3',
 	    'news/slrn',
 	    'news/tin',
+	    'ports-mgmt/p5-FreeBSD-Portindex',
+	    'ports-mgmt/portaudit',
+	    'ports-mgmt/portmaster',
 	    'ports-mgmt/portupgrade',
 	    'print/a2ps-letter',
 	    'print/apsfilter',
 	    'print/ghostscript7-nox11',
-	    'print/gv',
 	    'print/psutils-letter',
+	    'print/gv',
 	    'shells/bash',
 	    'shells/pdksh',
 	    'shells/zsh',
 	    'security/sudo',
+	    'sysutils/screen',
 	    'www/links',
 	    'www/lynx',
+	    'x11/gnome2',
+	    'x11/kde4',
 	    'x11/rxvt',
-	    'ports-mgmt/portaudit'])
+	    'x11/xorg',
+	    'x11-wm/afterstep',
+	    'x11-wm/fvwm2',
+	    'x11-wm/windowmaker'])
     return pkgs
 
 # The list of desired packages

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 14:06:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 933D31065692;
	Tue, 20 Oct 2009 14:06:07 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 827538FC20;
	Tue, 20 Oct 2009 14:06:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KE67Px069150;
	Tue, 20 Oct 2009 14:06:07 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KE67J3069148;
	Tue, 20 Oct 2009 14:06:07 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <200910201406.n9KE67J3069148@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 20 Oct 2009 14:06:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198288 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 14:06:07 -0000

Author: avg
Date: Tue Oct 20 14:06:07 2009
New Revision: 198288
URL: http://svn.freebsd.org/changeset/base/198288

Log:
  ichwd.4: fix r198272, restore watchdogd(8) reference
  
  In r198272 I didn't notice that watchdog(8) and watchdogd(8)
  are different things and instead of fixing watchdogd markup
  I simply nuked the line.
  
  Noticed by:	emaste
  Pointy hat to:	avg

Modified:
  head/share/man/man4/ichwd.4

Modified: head/share/man/man4/ichwd.4
==============================================================================
--- head/share/man/man4/ichwd.4	Tue Oct 20 13:58:30 2009	(r198287)
+++ head/share/man/man4/ichwd.4	Tue Oct 20 14:06:07 2009	(r198288)
@@ -66,6 +66,7 @@ it believes the WDT is disabled.
 .Sh SEE ALSO
 .Xr watchdog 4 ,
 .Xr watchdog 8 ,
+.Xr watchdogd 8 ,
 .Xr watchdog 9
 .Rs
 .%T Using the Intel ICH Family Watchdog Timer (WDT)

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 14:57:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EDE4106566B;
	Tue, 20 Oct 2009 14:57:27 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2DD298FC17;
	Tue, 20 Oct 2009 14:57:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KEvQhB070184;
	Tue, 20 Oct 2009 14:57:26 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KEvQ9i070182;
	Tue, 20 Oct 2009 14:57:26 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <200910201457.n9KEvQ9i070182@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Tue, 20 Oct 2009 14:57:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198289 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 14:57:27 -0000

Author: jh
Date: Tue Oct 20 14:57:26 2009
New Revision: 198289
URL: http://svn.freebsd.org/changeset/base/198289

Log:
  Fix comment typos.
  
  Reviewed by:	rmacklem
  Approved by:	trasz (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Tue Oct 20 14:06:07 2009	(r198288)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Tue Oct 20 14:57:26 2009	(r198289)
@@ -36,9 +36,9 @@ __FBSDID("$FreeBSD$");
  * - The correct granularity of an OpenOwner is not nearly so
  *   obvious. An OpenOwner does the following:
  *   - provides a serial sequencing of Open/Close/Lock-with-new-lockowner
- *   - is used to check for Open/SHare contention (not applicable to
+ *   - is used to check for Open/Share contention (not applicable to
  *     this client, since all Opens are Deny_None)
- *   As such, I considered both extrema.
+ *   As such, I considered both extreme.
  *   1 OpenOwner per ClientID - Simple to manage, but fully serializes
  *   all Open, Close and Lock (with a new lockowner) Ops.
  *   1 OpenOwner for each Open - This one results in an OpenConfirm for
@@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$");
  *   which of these the vnodeop close applies to. This is handled by
  *   delaying the Close Op(s) until all of the Opens have been closed.
  *   (It is not yet obvious if this is the correct granularity.)
- * - How the code handles serailization:
- *   - For the ClientId, is uses an exclusive lock while getting its
+ * - How the code handles serialization:
+ *   - For the ClientId, it uses an exclusive lock while getting its
  *     SetClientId and during recovery. Otherwise, it uses a shared
  *     lock via a reference count.
  *   - For the rest of the data structures, it uses an SMP mutex

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 15:01:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B90C9106568D;
	Tue, 20 Oct 2009 15:01:46 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A81058FC1D;
	Tue, 20 Oct 2009 15:01:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KF1kSL070314;
	Tue, 20 Oct 2009 15:01:46 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KF1k6b070312;
	Tue, 20 Oct 2009 15:01:46 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <200910201501.n9KF1k6b070312@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Tue, 20 Oct 2009 15:01:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198290 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 15:01:46 -0000

Author: jh
Date: Tue Oct 20 15:01:46 2009
New Revision: 198290
URL: http://svn.freebsd.org/changeset/base/198290

Log:
  Fix ordering of nfscl_modevent() and ncl_uninit(). nfscl_modevent() must
  be called after ncl_uninit() when unloading the nfscl module because
  ncl_uninit() uses ncl_iod_mutex which is destroyed in nfscl_modevent().
  
  Reviewed by:	rmacklem
  Approved by:	trasz (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clport.c

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Tue Oct 20 14:57:26 2009	(r198289)
+++ head/sys/fs/nfsclient/nfs_clport.c	Tue Oct 20 15:01:46 2009	(r198290)
@@ -1261,7 +1261,7 @@ static moduledata_t nfscl_mod = {
 	nfscl_modevent,
 	NULL,
 };
-DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_VFS, SI_ORDER_ANY);
+DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_VFS, SI_ORDER_FIRST);
 
 /* So that loader and kldload(2) can find us, wherever we are.. */
 MODULE_VERSION(nfscl, 1);

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 15:06:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC82F106566C;
	Tue, 20 Oct 2009 15:06:18 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AB9968FC1E;
	Tue, 20 Oct 2009 15:06:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KF6Ifs070426;
	Tue, 20 Oct 2009 15:06:18 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KF6IvV070423;
	Tue, 20 Oct 2009 15:06:18 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <200910201506.n9KF6IvV070423@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Tue, 20 Oct 2009 15:06:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198291 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 15:06:18 -0000

Author: jh
Date: Tue Oct 20 15:06:18 2009
New Revision: 198291
URL: http://svn.freebsd.org/changeset/base/198291

Log:
  Unloading of the nfscl module is unsupported because newnfslock doesn't
  support unloading. It's not trivial to implement newnfslock unloading so
  for now just admit that unloading is unsupported and refuse to attempt
  unload in all nfscl module event handlers.
  
  Reviewed by:	rmacklem
  Approved by:	trasz (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfs_clsubs.c

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Tue Oct 20 15:01:46 2009	(r198290)
+++ head/sys/fs/nfsclient/nfs_clport.c	Tue Oct 20 15:06:18 2009	(r198291)
@@ -1243,6 +1243,10 @@ nfscl_modevent(module_t mod, int type, v
 			break;
 		}
 
+		/*
+		 * XXX: Unloading of nfscl module is unsupported.
+		 */
+#if 0
 		ncl_call_invalcaches = NULL;
 		nfsd_call_nfscl = NULL;
 		/* and get rid of the mutexes */
@@ -1250,6 +1254,9 @@ nfscl_modevent(module_t mod, int type, v
 		mtx_destroy(&ncl_iod_mutex);
 		loaded = 0;
 		break;
+#else
+		/* FALLTHROUGH */
+#endif
 	default:
 		error = EOPNOTSUPP;
 		break;

Modified: head/sys/fs/nfsclient/nfs_clsubs.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clsubs.c	Tue Oct 20 15:01:46 2009	(r198290)
+++ head/sys/fs/nfsclient/nfs_clsubs.c	Tue Oct 20 15:06:18 2009	(r198291)
@@ -87,6 +87,10 @@ extern struct nfsstats newnfsstats;
 int
 ncl_uninit(struct vfsconf *vfsp)
 {
+	/*
+	 * XXX: Unloading of nfscl module is unsupported.
+	 */
+#if 0
 	int i;
 
 	/*
@@ -104,6 +108,9 @@ ncl_uninit(struct vfsconf *vfsp)
 	mtx_unlock(&ncl_iod_mutex);
 	ncl_nhuninit();
 	return (0);
+#else
+	return (EOPNOTSUPP);
+#endif
 }
 
 void 

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 16:36:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6C22106566B;
	Tue, 20 Oct 2009 16:36:51 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B00D8FC1B;
	Tue, 20 Oct 2009 16:36:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KGapaW072137;
	Tue, 20 Oct 2009 16:36:51 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KGapWo072133;
	Tue, 20 Oct 2009 16:36:51 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200910201636.n9KGapWo072133@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Tue, 20 Oct 2009 16:36:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198295 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 16:36:51 -0000

Author: ru
Date: Tue Oct 20 16:36:51 2009
New Revision: 198295
URL: http://svn.freebsd.org/changeset/base/198295

Log:
  Random number generator initialization cleanup:
  
  - Introduce new SI_SUB_RANDOM point in boot sequence to make it
  clear from where one may start using random(9).  It should be as
  early as possible, so place it just after SI_SUB_CPU where we
  have some randomness on most platforms via get_cyclecount().
  
  - Move stack protector initialization to be after SI_SUB_RANDOM
  as before this point we have no randomness at all.  This fixes
  stack protector to actually protect stack with some random guard
  value instead of a well-known one.
  
  Note that this patch doesn't try to address arc4random(9) issues.
  With current code, it will be implicitly seeded by stack protector
  and hence will get the same entropy as random(9).  It will be
  securely reseeded once /dev/random is feeded by some entropy from
  userland.
  
  Submitted by:	Maxim Dounin 
  MFC after:	3 days

Modified:
  head/sys/kern/init_main.c
  head/sys/kern/stack_protector.c
  head/sys/sys/kernel.h

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Tue Oct 20 16:32:38 2009	(r198294)
+++ head/sys/kern/init_main.c	Tue Oct 20 16:36:51 2009	(r198295)
@@ -570,6 +570,19 @@ proc0_post(void *dummy __unused)
 }
 SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL);
 
+static void
+random_init(void *dummy __unused)
+{
+
+	/*
+	 * After CPU has been started we have some randomness on most
+	 * platforms via get_cyclecount().  For platforms that don't
+	 * we will reseed random(9) in proc0_post() as well.
+	 */
+	srandom(get_cyclecount());
+}
+SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL);
+
 /*
  ***************************************************************************
  ****

Modified: head/sys/kern/stack_protector.c
==============================================================================
--- head/sys/kern/stack_protector.c	Tue Oct 20 16:32:38 2009	(r198294)
+++ head/sys/kern/stack_protector.c	Tue Oct 20 16:36:51 2009	(r198295)
@@ -28,5 +28,4 @@ __stack_chk_init(void *dummy __unused)
 	for (i = 0; i < __arraycount(guard); i++)
 		__stack_chk_guard[i] = guard[i];
 }
-/* SI_SUB_EVENTHANDLER is right after SI_SUB_LOCK used by arc4rand() init. */
-SYSINIT(stack_chk, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, __stack_chk_init, NULL);
+SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL);

Modified: head/sys/sys/kernel.h
==============================================================================
--- head/sys/sys/kernel.h	Tue Oct 20 16:32:38 2009	(r198294)
+++ head/sys/sys/kernel.h	Tue Oct 20 16:36:51 2009	(r198295)
@@ -109,6 +109,7 @@ enum sysinit_sub_id {
 	SI_SUB_VNET_PRELINK	= 0x1E00000,	/* vnet init before modules */
 	SI_SUB_KLD		= 0x2000000,	/* KLD and module setup */
 	SI_SUB_CPU		= 0x2100000,	/* CPU resource(s)*/
+	SI_SUB_RANDOM		= 0x2120000,	/* random number generator */
 	SI_SUB_KDTRACE		= 0x2140000,	/* Kernel dtrace hooks */
 	SI_SUB_MAC		= 0x2180000,	/* TrustedBSD MAC subsystem */
 	SI_SUB_MAC_POLICY	= 0x21C0000,	/* TrustedBSD MAC policies */

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 17:55:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4CC1106566B;
	Tue, 20 Oct 2009 17:55:42 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 940A88FC1A;
	Tue, 20 Oct 2009 17:55:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KHtgZI073968;
	Tue, 20 Oct 2009 17:55:42 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KHtgT9073966;
	Tue, 20 Oct 2009 17:55:42 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <200910201755.n9KHtgT9073966@svn.freebsd.org>
From: Qing Li 
Date: Tue, 20 Oct 2009 17:55:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198301 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 17:55:42 -0000

Author: qingli
Date: Tue Oct 20 17:55:42 2009
New Revision: 198301
URL: http://svn.freebsd.org/changeset/base/198301

Log:
  In the ARP callout timer expiration function, the current time_second
  is compared against the entry expiration time value (that was set based
  on time_second) to check if the current time is larger than the set
  expiration time. Due to the +/- timer granularity value, the comparison
  returns false, causing the alternative code to be executed. The
  alternative code path freed the memory without removing that entry
  from the table list, causing a use-after-free bug.
  
  Reviewed by:	discussed with kmacy
  MFC after:	immediately
  Verified by:	rnoland, yongari

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Tue Oct 20 17:50:36 2009	(r198300)
+++ head/sys/netinet/if_ether.c	Tue Oct 20 17:55:42 2009	(r198301)
@@ -175,18 +175,18 @@ arptimer(void *arg)
 	CURVNET_SET(ifp->if_vnet);
 	IF_AFDATA_LOCK(ifp);
 	LLE_WLOCK(lle);
-	if (((lle->la_flags & LLE_DELETED) ||
-	    (time_second >= lle->la_expire)) &&
-	    (!callout_pending(&lle->la_timer) &&
+	if ((!callout_pending(&lle->la_timer) &&
 	    callout_active(&lle->la_timer))) {
 		(void) llentry_free(lle);
 		ARPSTAT_INC(timeouts);
-	} else {
-		/*
-		 * Still valid, just drop our reference
-		 */
-		LLE_FREE_LOCKED(lle);
+	} 
+#ifdef DIAGNOSTICS
+	else {
+		struct sockaddr *l3addr = L3_ADDR(lle);
+		log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle,
+		    inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr));
 	}
+#endif
 	IF_AFDATA_UNLOCK(ifp);
 	CURVNET_RESTORE();
 }
@@ -377,7 +377,7 @@ retry:
 
 	if (renew) {
 		LLE_ADDREF(la);
-		la->la_expire = time_second;
+		la->la_expire = time_second + V_arpt_down;
 		callout_reset(&la->la_timer, hz * V_arpt_down, arptimer, la);
 		la->la_asked++;
 		LLE_WUNLOCK(la);

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 18:09:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99B1E1065693
	for ; Tue, 20 Oct 2009 18:09:16 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4])
	by mx1.freebsd.org (Postfix) with ESMTP id 4C34C8FC20
	for ; Tue, 20 Oct 2009 18:09:16 +0000 (UTC)
Received: (qmail 2464 invoked by uid 399); 20 Oct 2009 18:09:15 -0000
Received: from localhost (HELO foreign.dougb.net)
	(dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 20 Oct 2009 18:09:15 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Message-ID: <4ADDFCCC.8070204@FreeBSD.org>
Date: Tue, 20 Oct 2009 11:09:16 -0700
From: Doug Barton 
Organization: http://SupersetSolutions.com/
User-Agent: Thunderbird 2.0.0.23 (X11/20090822)
MIME-Version: 1.0
To: Ruslan Ermilov 
References: <200910201636.n9KGapWo072133@svn.freebsd.org>
In-Reply-To: <200910201636.n9KGapWo072133@svn.freebsd.org>
X-Enigmail-Version: 0.96.0
OpenPGP: id=D5B2F0FB
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198295 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 18:09:16 -0000

Was this patch publicly reviewed anywhere? If so and I missed it I
apologize. Otherwise it would be very nice if it got some discussion,
review, etc. before it proceeds any further.

Something as important as how we use random numbers, especially in the
kernel, and especially as the system is initializing and entropy is
low really needs a lot of review. This is not meant as an aspersion on
Ruslan, Mr. Dounin, or anyone else involved.


Doug


Ruslan Ermilov wrote:
> Author: ru
> Date: Tue Oct 20 16:36:51 2009
> New Revision: 198295
> URL: http://svn.freebsd.org/changeset/base/198295
> 
> Log:
>   Random number generator initialization cleanup:
>   
>   - Introduce new SI_SUB_RANDOM point in boot sequence to make it
>   clear from where one may start using random(9).  It should be as
>   early as possible, so place it just after SI_SUB_CPU where we
>   have some randomness on most platforms via get_cyclecount().
>   
>   - Move stack protector initialization to be after SI_SUB_RANDOM
>   as before this point we have no randomness at all.  This fixes
>   stack protector to actually protect stack with some random guard
>   value instead of a well-known one.
>   
>   Note that this patch doesn't try to address arc4random(9) issues.
>   With current code, it will be implicitly seeded by stack protector
>   and hence will get the same entropy as random(9).  It will be
>   securely reseeded once /dev/random is feeded by some entropy from
>   userland.
>   
>   Submitted by:	Maxim Dounin 
>   MFC after:	3 days
> 
> Modified:
>   head/sys/kern/init_main.c
>   head/sys/kern/stack_protector.c
>   head/sys/sys/kernel.h
> 
> Modified: head/sys/kern/init_main.c
> ==============================================================================
> --- head/sys/kern/init_main.c	Tue Oct 20 16:32:38 2009	(r198294)
> +++ head/sys/kern/init_main.c	Tue Oct 20 16:36:51 2009	(r198295)
> @@ -570,6 +570,19 @@ proc0_post(void *dummy __unused)
>  }
>  SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL);
>  
> +static void
> +random_init(void *dummy __unused)
> +{
> +
> +	/*
> +	 * After CPU has been started we have some randomness on most
> +	 * platforms via get_cyclecount().  For platforms that don't
> +	 * we will reseed random(9) in proc0_post() as well.
> +	 */
> +	srandom(get_cyclecount());
> +}
> +SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL);
> +
>  /*
>   ***************************************************************************
>   ****
> 
> Modified: head/sys/kern/stack_protector.c
> ==============================================================================
> --- head/sys/kern/stack_protector.c	Tue Oct 20 16:32:38 2009	(r198294)
> +++ head/sys/kern/stack_protector.c	Tue Oct 20 16:36:51 2009	(r198295)
> @@ -28,5 +28,4 @@ __stack_chk_init(void *dummy __unused)
>  	for (i = 0; i < __arraycount(guard); i++)
>  		__stack_chk_guard[i] = guard[i];
>  }
> -/* SI_SUB_EVENTHANDLER is right after SI_SUB_LOCK used by arc4rand() init. */
> -SYSINIT(stack_chk, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, __stack_chk_init, NULL);
> +SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL);
> 
> Modified: head/sys/sys/kernel.h
> ==============================================================================
> --- head/sys/sys/kernel.h	Tue Oct 20 16:32:38 2009	(r198294)
> +++ head/sys/sys/kernel.h	Tue Oct 20 16:36:51 2009	(r198295)
> @@ -109,6 +109,7 @@ enum sysinit_sub_id {
>  	SI_SUB_VNET_PRELINK	= 0x1E00000,	/* vnet init before modules */
>  	SI_SUB_KLD		= 0x2000000,	/* KLD and module setup */
>  	SI_SUB_CPU		= 0x2100000,	/* CPU resource(s)*/
> +	SI_SUB_RANDOM		= 0x2120000,	/* random number generator */
>  	SI_SUB_KDTRACE		= 0x2140000,	/* Kernel dtrace hooks */
>  	SI_SUB_MAC		= 0x2180000,	/* TrustedBSD MAC subsystem */
>  	SI_SUB_MAC_POLICY	= 0x21C0000,	/* TrustedBSD MAC policies */
> 


-- 

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/


From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 18:58:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DF0E1065679;
	Tue, 20 Oct 2009 18:58:29 +0000 (UTC)
	(envelope-from gallatin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1CBF88FC08;
	Tue, 20 Oct 2009 18:58:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KIwSKB075458;
	Tue, 20 Oct 2009 18:58:28 GMT
	(envelope-from gallatin@svn.freebsd.org)
Received: (from gallatin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KIwSDS075456;
	Tue, 20 Oct 2009 18:58:28 GMT
	(envelope-from gallatin@svn.freebsd.org)
Message-Id: <200910201858.n9KIwSDS075456@svn.freebsd.org>
From: Andrew Gallatin 
Date: Tue, 20 Oct 2009 18:58:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198303 - head/sys/dev/mxge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 18:58:29 -0000

Author: gallatin
Date: Tue Oct 20 18:58:28 2009
New Revision: 198303
URL: http://svn.freebsd.org/changeset/base/198303

Log:
  Make mxge do a better job recovering from NIC h/w faults
  by checking PCI config space when the NIC is not
  transmitting.  Previously, a h/w fault would not have been
  detected if the NIC was down, or handling an RX only
  workload.

Modified:
  head/sys/dev/mxge/if_mxge.c

Modified: head/sys/dev/mxge/if_mxge.c
==============================================================================
--- head/sys/dev/mxge/if_mxge.c	Tue Oct 20 18:54:51 2009	(r198302)
+++ head/sys/dev/mxge/if_mxge.c	Tue Oct 20 18:58:28 2009	(r198303)
@@ -3640,7 +3640,6 @@ mxge_open(mxge_softc_t *sc)
 #endif
 	sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
 	sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-	callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc);
 
 	return 0;
 
@@ -3661,7 +3660,6 @@ mxge_close(mxge_softc_t *sc, int down)
 	int slice;
 #endif
 
-	callout_stop(&sc->co_hdl);
 #ifdef IFNET_BUF_RING
 	for (slice = 0; slice < sc->num_slices; slice++) {
 		ss = &sc->ss[slice];
@@ -3836,9 +3834,9 @@ mxge_watchdog_reset(mxge_softc_t *sc)
 	if (err) {
 		device_printf(sc->dev, "watchdog reset failed\n");
 	} else {
-		if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING)
-			callout_reset(&sc->co_hdl, mxge_ticks,
-				      mxge_tick, sc);
+		if (sc->dying == 2)
+			sc->dying = 0;
+		callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc);
 	}
 }
 
@@ -3909,10 +3907,11 @@ mxge_watchdog(mxge_softc_t *sc)
 	return (err);
 }
 
-static void
+static u_long
 mxge_update_stats(mxge_softc_t *sc)
 {
 	struct mxge_slice_state *ss;
+	u_long pkts = 0;
 	u_long ipackets = 0;
 	u_long opackets = 0;
 #ifdef IFNET_BUF_RING
@@ -3934,6 +3933,8 @@ mxge_update_stats(mxge_softc_t *sc)
 #endif
 		oerrors += ss->oerrors;
 	}
+	pkts = (ipackets - sc->ifp->if_ipackets);
+	pkts += (opackets - sc->ifp->if_opackets);
 	sc->ifp->if_ipackets = ipackets;
 	sc->ifp->if_opackets = opackets;
 #ifdef IFNET_BUF_RING
@@ -3942,23 +3943,45 @@ mxge_update_stats(mxge_softc_t *sc)
 	sc->ifp->if_snd.ifq_drops = odrops;
 #endif
 	sc->ifp->if_oerrors = oerrors;
+	return pkts;
 }
 
 static void
 mxge_tick(void *arg)
 {
 	mxge_softc_t *sc = arg;
+	u_long pkts = 0;
 	int err = 0;
+	int running, ticks;
+	uint16_t cmd;
 
-	/* aggregate stats from different slices */
-	mxge_update_stats(sc);
-	if (!sc->watchdog_countdown) {
-		err = mxge_watchdog(sc);
-		sc->watchdog_countdown = 4;
+	ticks = mxge_ticks;
+	mtx_lock(&sc->driver_mtx);
+	running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING;
+	mtx_unlock(&sc->driver_mtx);
+	if (running) {
+		/* aggregate stats from different slices */
+		pkts = mxge_update_stats(sc);
+		if (!sc->watchdog_countdown) {
+			err = mxge_watchdog(sc);
+			sc->watchdog_countdown = 4;
+		}
+		sc->watchdog_countdown--;
+	}
+	if (pkts == 0) {
+		/* ensure NIC did not suffer h/w fault while idle */
+		cmd = pci_read_config(sc->dev, PCIR_COMMAND, 2);		
+		if ((cmd & PCIM_CMD_BUSMASTEREN) == 0) {
+			sc->dying = 2;
+			taskqueue_enqueue(sc->tq, &sc->watchdog_task);
+			err = ENXIO;
+		}
+		/* look less often if NIC is idle */
+		ticks *= 4;
 	}
-	sc->watchdog_countdown--;
+
 	if (err == 0)
-		callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc);
+		callout_reset(&sc->co_hdl, ticks, mxge_tick, sc);
 
 }
 
@@ -4747,6 +4770,7 @@ mxge_attach(device_t dev)
 	ifp->if_transmit = mxge_transmit;
 	ifp->if_qflush = mxge_qflush;
 #endif
+	callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc);
 	return 0;
 
 abort_with_rings:

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 21:08:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB99A106566B;
	Tue, 20 Oct 2009 21:08:32 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A7B58FC12;
	Tue, 20 Oct 2009 21:08:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KL8WRF078548;
	Tue, 20 Oct 2009 21:08:32 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KL8W1K078546;
	Tue, 20 Oct 2009 21:08:32 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <200910202108.n9KL8W1K078546@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 20 Oct 2009 21:08:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198305 - head/tools/regression/fstest/tests/rename
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 21:08:32 -0000

Author: pjd
Date: Tue Oct 20 21:08:32 2009
New Revision: 198305
URL: http://svn.freebsd.org/changeset/base/198305

Log:
  Fix a case where rename actually succeeds, which is also expected behaviour
  according to POSIX. This fixes ZFS on Solaris testing.
  
  Submitted by:	Milan Cermak 

Modified:
  head/tools/regression/fstest/tests/rename/21.t

Modified: head/tools/regression/fstest/tests/rename/21.t
==============================================================================
--- head/tools/regression/fstest/tests/rename/21.t	Tue Oct 20 19:05:43 2009	(r198304)
+++ head/tools/regression/fstest/tests/rename/21.t	Tue Oct 20 21:08:32 2009	(r198305)
@@ -6,7 +6,7 @@ desc="write access to subdirectory is re
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..15"
+echo "1..16"
 
 n0=`namegen`
 n1=`namegen`
@@ -30,8 +30,9 @@ expect "0|EACCES" -u 65534 -g 65534 rena
 # to move ${n0} from ${n2} to ${n3}.
 expect "0|EACCES" -u 65534 -g 65534 rename ${n2}/${n0} ${n3}/${n1}
 
-expect 0 rmdir ${n2}/${n0}
+expect "0|ENOENT" rmdir ${n2}/${n0}
 expect ENOENT rmdir ${n2}/${n0}
+expect "0|ENOENT" rmdir ${n3}/${n1}
 expect ENOENT rmdir ${n3}/${n1}
 
 # Check that write permission on containing directory (${n2}) is enough

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 21:27:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EFFC106566C;
	Tue, 20 Oct 2009 21:27:04 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E6AB8FC08;
	Tue, 20 Oct 2009 21:27:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KLR37W078965;
	Tue, 20 Oct 2009 21:27:03 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KLR3Vl078963;
	Tue, 20 Oct 2009 21:27:03 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <200910202127.n9KLR3Vl078963@svn.freebsd.org>
From: Qing Li 
Date: Tue, 20 Oct 2009 21:27:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198306 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 21:27:04 -0000

Author: qingli
Date: Tue Oct 20 21:27:03 2009
New Revision: 198306
URL: http://svn.freebsd.org/changeset/base/198306

Log:
  The flow-table function flowtable_route_flush() may be called
  during system initialization time. Since the flow-table is
  designed to maintain per CPU flow cache, the existing code
  did not check whether "smp_started" is true before calling
  sched_bind() and sched_unbind(), which triggers a page fault.
  
  Reviewed by:	jeff
  MFC after:	immediately

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Tue Oct 20 21:08:32 2009	(r198305)
+++ head/sys/net/flowtable.c	Tue Oct 20 21:27:03 2009	(r198306)
@@ -930,16 +930,20 @@ flowtable_route_flush(struct flowtable *
 		for (i = 0; i <= mp_maxid; i++) {
 			if (CPU_ABSENT(i))
 				continue;
-
-			thread_lock(curthread);
-			sched_bind(curthread, i);
-			thread_unlock(curthread);
+			
+			if (smp_started == 1) {
+				thread_lock(curthread);
+				sched_bind(curthread, i);
+				thread_unlock(curthread);
+			}
 
 			flowtable_free_stale(ft, rt);
 
-			thread_lock(curthread);
-			sched_unbind(curthread);
-			thread_unlock(curthread);
+			if (smp_started == 1) {
+				thread_lock(curthread);
+				sched_unbind(curthread);
+				thread_unlock(curthread);
+			}
 		}
 	} else {
 		flowtable_free_stale(ft, rt);

From owner-svn-src-head@FreeBSD.ORG  Tue Oct 20 21:29:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E3DD106566B;
	Tue, 20 Oct 2009 21:29:47 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D7478FC08;
	Tue, 20 Oct 2009 21:29:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KLTlj7079053;
	Tue, 20 Oct 2009 21:29:47 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9KLTlXO079051;
	Tue, 20 Oct 2009 21:29:47 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200910202129.n9KLTlXO079051@svn.freebsd.org>
From: Andrew Thompson 
Date: Tue, 20 Oct 2009 21:29:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198307 - head/sys/dev/usb/storage
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 20 Oct 2009 21:29:47 -0000

Author: thompsa
Date: Tue Oct 20 21:29:46 2009
New Revision: 198307
URL: http://svn.freebsd.org/changeset/base/198307

Log:
  Change from CAM_TID_INVALID to CAM_SEL_TIMEOUT error code when the usb device
  has been yanked, this works around a cam recounting bug when
  CAM_DEV_UNCONFIGURED is set late in the detach. In certain conditions the
  reference to the XPT device would not be released which would cause the usb
  explore thread to sleep forever on "simfree", preventing any new usb devices to
  be found/ejected on the bus.
  
  This is intended to be a quick workaround to the problem without touching CAM
  so it can be merged to 8.0.
  
  Suggested by:	mav
  MFC after:	3 days

Modified:
  head/sys/dev/usb/storage/umass.c

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c	Tue Oct 20 21:27:03 2009	(r198306)
+++ head/sys/dev/usb/storage/umass.c	Tue Oct 20 21:29:46 2009	(r198307)
@@ -2860,8 +2860,9 @@ umass_cam_action(struct cam_sim *sim, un
 {
 	struct umass_softc *sc = (struct umass_softc *)sim->softc;
 
-	if (sc == UMASS_GONE) {
-		ccb->ccb_h.status = CAM_TID_INVALID;
+	if (sc == UMASS_GONE ||
+	    (sc != NULL && !usbd_device_attached(sc->sc_udev))) {
+		ccb->ccb_h.status = CAM_SEL_TIMEOUT;
 		xpt_done(ccb);
 		return;
 	}

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 02:37:24 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CC7CF106566B;
	Wed, 21 Oct 2009 02:37:24 +0000 (UTC)
	(envelope-from mdounin@mdounin.ru)
Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D88B8FC1D;
	Wed, 21 Oct 2009 02:37:24 +0000 (UTC)
Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81])
	by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 7D0D317019;
	Wed, 21 Oct 2009 06:21:29 +0400 (MSD)
Date: Wed, 21 Oct 2009 06:21:29 +0400
From: Maxim Dounin 
To: Doug Barton 
Message-ID: <20091021022128.GR1144@mdounin.ru>
References: <200910201636.n9KGapWo072133@svn.freebsd.org>
	<4ADDFCCC.8070204__19944.4177946591$1256062254$gmane$org@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4ADDFCCC.8070204__19944.4177946591$1256062254$gmane$org@FreeBSD.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ruslan Ermilov 
Subject: Re: svn commit: r198295 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 02:37:24 -0000

Hello!

On Tue, Oct 20, 2009 at 11:09:16AM -0700, Doug Barton wrote:

> Was this patch publicly reviewed anywhere? If so and I missed it I
> apologize.

Not really.  It was part of suggested patch during secteam@ work 
on FreeBSD-SA-08:11.arc4random, but was dropped as irrelevant to 
advisory itself.

> Otherwise it would be very nice if it got some discussion,
> review, etc. before it proceeds any further.
>
> Something as important as how we use random numbers, especially in the
> kernel, and especially as the system is initializing and entropy is
> low really needs a lot of review. This is not meant as an aspersion on
> Ruslan, Mr. Dounin, or anyone else involved.

Sure.  Feel free to ask if you have questions.

But actually the bad thing is that this patch just can't break 
anything as there is nothing to break.  Without the patch kernel 
has no entropy in random(9) until after proc0_post(), and no 
entropy in arc4random(9) until after reseed from userland.

Maxim Dounin

> 
> 
> Doug
> 
> 
> Ruslan Ermilov wrote:
> > Author: ru
> > Date: Tue Oct 20 16:36:51 2009
> > New Revision: 198295
> > URL: http://svn.freebsd.org/changeset/base/198295
> > 
> > Log:
> >   Random number generator initialization cleanup:
> >   
> >   - Introduce new SI_SUB_RANDOM point in boot sequence to make it
> >   clear from where one may start using random(9).  It should be as
> >   early as possible, so place it just after SI_SUB_CPU where we
> >   have some randomness on most platforms via get_cyclecount().
> >   
> >   - Move stack protector initialization to be after SI_SUB_RANDOM
> >   as before this point we have no randomness at all.  This fixes
> >   stack protector to actually protect stack with some random guard
> >   value instead of a well-known one.
> >   
> >   Note that this patch doesn't try to address arc4random(9) issues.
> >   With current code, it will be implicitly seeded by stack protector
> >   and hence will get the same entropy as random(9).  It will be
> >   securely reseeded once /dev/random is feeded by some entropy from
> >   userland.
> >   
> >   Submitted by:	Maxim Dounin 
> >   MFC after:	3 days
> > 
> > Modified:
> >   head/sys/kern/init_main.c
> >   head/sys/kern/stack_protector.c
> >   head/sys/sys/kernel.h
> > 
> > Modified: head/sys/kern/init_main.c
> > ==============================================================================
> > --- head/sys/kern/init_main.c	Tue Oct 20 16:32:38 2009	(r198294)
> > +++ head/sys/kern/init_main.c	Tue Oct 20 16:36:51 2009	(r198295)
> > @@ -570,6 +570,19 @@ proc0_post(void *dummy __unused)
> >  }
> >  SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL);
> >  
> > +static void
> > +random_init(void *dummy __unused)
> > +{
> > +
> > +	/*
> > +	 * After CPU has been started we have some randomness on most
> > +	 * platforms via get_cyclecount().  For platforms that don't
> > +	 * we will reseed random(9) in proc0_post() as well.
> > +	 */
> > +	srandom(get_cyclecount());
> > +}
> > +SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL);
> > +
> >  /*
> >   ***************************************************************************
> >   ****
> > 
> > Modified: head/sys/kern/stack_protector.c
> > ==============================================================================
> > --- head/sys/kern/stack_protector.c	Tue Oct 20 16:32:38 2009	(r198294)
> > +++ head/sys/kern/stack_protector.c	Tue Oct 20 16:36:51 2009	(r198295)
> > @@ -28,5 +28,4 @@ __stack_chk_init(void *dummy __unused)
> >  	for (i = 0; i < __arraycount(guard); i++)
> >  		__stack_chk_guard[i] = guard[i];
> >  }
> > -/* SI_SUB_EVENTHANDLER is right after SI_SUB_LOCK used by arc4rand() init. */
> > -SYSINIT(stack_chk, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, __stack_chk_init, NULL);
> > +SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL);
> > 
> > Modified: head/sys/sys/kernel.h
> > ==============================================================================
> > --- head/sys/sys/kernel.h	Tue Oct 20 16:32:38 2009	(r198294)
> > +++ head/sys/sys/kernel.h	Tue Oct 20 16:36:51 2009	(r198295)
> > @@ -109,6 +109,7 @@ enum sysinit_sub_id {
> >  	SI_SUB_VNET_PRELINK	= 0x1E00000,	/* vnet init before modules */
> >  	SI_SUB_KLD		= 0x2000000,	/* KLD and module setup */
> >  	SI_SUB_CPU		= 0x2100000,	/* CPU resource(s)*/
> > +	SI_SUB_RANDOM		= 0x2120000,	/* random number generator */
> >  	SI_SUB_KDTRACE		= 0x2140000,	/* Kernel dtrace hooks */
> >  	SI_SUB_MAC		= 0x2180000,	/* TrustedBSD MAC subsystem */
> >  	SI_SUB_MAC_POLICY	= 0x21C0000,	/* TrustedBSD MAC policies */
> > 
> 
> 
> -- 
> 
> 	Improve the effectiveness of your Internet presence with
> 	a domain name makeover!    http://SupersetSolutions.com/
> 
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
> 
> 

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 04:28:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 975CE106566B;
	Wed, 21 Oct 2009 04:28:52 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from mail.vega.ru (mail.vega.ru [90.156.167.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 5063A8FC0A;
	Wed, 21 Oct 2009 04:28:52 +0000 (UTC)
Received: from [10.100.124.99] (port=62016 helo=edoofus.dev.vega.ru)
	by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1N0S81-0002s3-KF; Wed, 21 Oct 2009 07:44:49 +0400
Date: Wed, 21 Oct 2009 07:44:45 +0400
From: Ruslan Ermilov 
To: Qing Li 
Message-ID: <20091021034444.GA29506@edoofus.dev.vega.ru>
References: <200910201755.n9KHtgT9073966@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200910201755.n9KHtgT9073966@svn.freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198301 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 04:28:52 -0000

On Tue, Oct 20, 2009 at 05:55:42PM +0000, Qing Li wrote:
> Modified: head/sys/netinet/if_ether.c
[...]
> +#ifdef DIAGNOSTICS
> +	else {
> +		struct sockaddr *l3addr = L3_ADDR(lle);
> +		log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle,
> +		    inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr));
>  	}
> +#endif

The actual option's name is DIAGNOSTIC, not DIAGNOSTICS.

netinet/in.c:#ifdef DIAGNOSTICS
netinet/in.c:#ifdef DIAGNOSTICS
netinet/in.c:#ifdef DIAGNOSTICS
netinet/if_ether.c:#ifdef DIAGNOSTICS
netinet6/in6.c:#ifdef DIAGNOSTICS

fs/smbfs/smbfs_vfsops.c:#ifdef DIAGNOSTICS


Cheers,
-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 07:58:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 292E61065676;
	Wed, 21 Oct 2009 07:58:21 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id F18DF8FC1F;
	Wed, 21 Oct 2009 07:58:20 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 0EB1546B17;
	Wed, 21 Oct 2009 03:58:20 -0400 (EDT)
Date: Wed, 21 Oct 2009 08:58:19 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Qing Li 
In-Reply-To: <200910201755.n9KHtgT9073966@svn.freebsd.org>
Message-ID: 
References: <200910201755.n9KHtgT9073966@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198301 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 07:58:21 -0000

On Tue, 20 Oct 2009, Qing Li wrote:

>  In the ARP callout timer expiration function, the current time_second
>  is compared against the entry expiration time value (that was set based
>  on time_second) to check if the current time is larger than the set
>  expiration time. Due to the +/- timer granularity value, the comparison
>  returns false, causing the alternative code to be executed. The
>  alternative code path freed the memory without removing that entry
>  from the table list, causing a use-after-free bug.
>
>  Reviewed by:	discussed with kmacy
>  MFC after:	immediately
>  Verified by:	rnoland, yongari

Could this be the same problem I ran into overnight on an 18 October kernel:

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address	= 0x7572749f
fault code		= supervisor read, page not present
instruction pointer	= 0x20:0xc09c0551
stack pointer	        = 0x28:0xc43f6ab4
frame pointer	        = 0x28:0xc43f6adc
code segment		= base 0x0, limit 0xfffff, type 0x1b
 			= DPL 0, pres 1, def32 1, gran 1
processor eflags	= interrupt enabled, resume, IOPL = 0
current process		= 0 (em0 taskq)

#9  0xc0be731b in calltrap () at ../../../i386/i386/exception.s:165
#10 0xc09c0551 in in_lltable_lookup (llt=0xc4955200, flags=8192,
     l3addr=0xc43f6b60) at ../../../netinet/in.c:1361
#11 0xc09b8ea7 in arpintr (m=0xc48dcd00) at if_llatbl.h:202
#12 0xc096f899 in netisr_dispatch_src (proto=7, source=0, m=0xc48dcd00)
     at ../../../net/netisr.c:917
#13 0xc096fb30 in netisr_dispatch (proto=7, m=0xc48dcd00)
     at ../../../net/netisr.c:1004
#14 0xc0967c11 in ether_demux (ifp=0xc470b400, m=0xc48dcd00)
     at ../../../net/if_ethersubr.c:895
#15 0xc0968163 in ether_input (ifp=0xc470b400, m=0xc48dcd00)
     at ../../../net/if_ethersubr.c:754
#16 0xc063bcaa in em_rxeof (adapter=0xc470d000, count=99)
     at ../../../dev/e1000/if_em.c:4610
#17 0xc063dfc7 in em_handle_rxtx (context=0xc470d000, pending=1)
     at ../../../dev/e1000/if_em.c:1763

(kgdb) frame 10
#10 0xc09c0551 in in_lltable_lookup (llt=0xc4955200, flags=8192,
     l3addr=0xc43f6b60) at ../../../netinet/in.c:1361
1361		LIST_FOREACH(lle, lleh, lle_next) {
(kgdb) list
1356		KASSERT(l3addr->sa_family == AF_INET,
1357		    ("sin_family %d", l3addr->sa_family));
1358
1359		hashkey = sin->sin_addr.s_addr;
1360		lleh = &llt->lle_head[LLATBL_HASH(hashkey, LLTBL_HASHMASK)];
1361		LIST_FOREACH(lle, lleh, lle_next) {
1362			struct sockaddr_in *sa2 = (struct sockaddr_in 
*)L3_ADDR(lle);
1363			if (lle->la_flags & LLE_DELETED)
1364				continue;
1365			if (sa2->sin_addr.s_addr == sin->sin_addr.s_addr)
(kgdb) print *llt
$5 = {llt_link = {sle_next = 0x0}, lle_head = {{lh_first = 0xc760d580}, {
       lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0xc75c3900}, {
       lh_first = 0x0} , {lh_first = 0xc49a8380}, {
       lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {
       lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {
       lh_first = 0x0}, {lh_first = 0xc61be780}, {lh_first = 0x0}, {
       lh_first = 0x0}, {lh_first = 0x0}}, llt_af = 2, llt_ifp = 0xc470b400,
   llt_new = 0xc09bdd60 ,
   llt_free = 0xc09c0490 ,
   llt_prefix_free = 0xc09c09b0 ,
   llt_lookup = 0xc09c0510 ,
   llt_rtcheck = 0xc09bdbe0 ,
   llt_dump = 0xc09bd9c0 }
(kgdb) print *l3addr
$6 = {sa_len = 16 '\020', sa_family = 2 '\002',
   sa_data = "\000\000??*\001\000\000\000\000\000\000\000"}
(kgdb) print lle
$7 = (struct llentry *) 0x75727473
(kgdb) print lleh
$8 = (struct llentries *) 0xc4955210
(kgdb) print *lleh
$9 = {lh_first = 0xc75c3900}

Your commit was after this kernel, so I'd be quite happy with the answer "now 
fixed" but wanted to be sure.

Robert

>
> Modified:
>  head/sys/netinet/if_ether.c
>
> Modified: head/sys/netinet/if_ether.c
> ==============================================================================
> --- head/sys/netinet/if_ether.c	Tue Oct 20 17:50:36 2009	(r198300)
> +++ head/sys/netinet/if_ether.c	Tue Oct 20 17:55:42 2009	(r198301)
> @@ -175,18 +175,18 @@ arptimer(void *arg)
> 	CURVNET_SET(ifp->if_vnet);
> 	IF_AFDATA_LOCK(ifp);
> 	LLE_WLOCK(lle);
> -	if (((lle->la_flags & LLE_DELETED) ||
> -	    (time_second >= lle->la_expire)) &&
> -	    (!callout_pending(&lle->la_timer) &&
> +	if ((!callout_pending(&lle->la_timer) &&
> 	    callout_active(&lle->la_timer))) {
> 		(void) llentry_free(lle);
> 		ARPSTAT_INC(timeouts);
> -	} else {
> -		/*
> -		 * Still valid, just drop our reference
> -		 */
> -		LLE_FREE_LOCKED(lle);
> +	}
> +#ifdef DIAGNOSTICS
> +	else {
> +		struct sockaddr *l3addr = L3_ADDR(lle);
> +		log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle,
> +		    inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr));
> 	}
> +#endif
> 	IF_AFDATA_UNLOCK(ifp);
> 	CURVNET_RESTORE();
> }
> @@ -377,7 +377,7 @@ retry:
>
> 	if (renew) {
> 		LLE_ADDREF(la);
> -		la->la_expire = time_second;
> +		la->la_expire = time_second + V_arpt_down;
> 		callout_reset(&la->la_timer, hz * V_arpt_down, arptimer, la);
> 		la->la_asked++;
> 		LLE_WUNLOCK(la);
>

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 08:10:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9C8CF1065670;
	Wed, 21 Oct 2009 08:10:07 +0000 (UTC)
	(envelope-from tomelite82@gmail.com)
Received: from mail-vw0-f189.google.com (mail-vw0-f189.google.com
	[209.85.212.189])
	by mx1.freebsd.org (Postfix) with ESMTP id 062488FC15;
	Wed, 21 Oct 2009 08:10:06 +0000 (UTC)
Received: by vws27 with SMTP id 27so2755775vws.3
	for ; Wed, 21 Oct 2009 01:10:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=CX/p8ivhubrBrElxdm4RkjnwRywkVIpNjBjqKBeE5kg=;
	b=SBhpxeQmpQCIX7X5XE+wuKyhx88jmFSSHtv7m8lToBXA56yIToeTGPbPnUewfcLPWi
	OxlZEE728pbTmPXinY2lLU9F+D7romO4qtYtZFVo+Rmma0Y7lm9EPD7R/Lsyt69i5u+q
	ug8u3zXAT0gGXGv2144Teor1lxeBeaz9tUSpg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=V+hT86dPMg/MZNE0HaB6zIra3QS48tW142yeNiNofui7twYxqmz7YuD+udy0itivN3
	tyq2o0YS96BNee8TuylT3Qh85FO5S/0YJsCrCRYf7A3aRQ7SzU0R4tj7ZfdV0j4Yz8zp
	HnBkn5/7jRrzI43qYfXrFcFt27VBhygHcGP0c=
MIME-Version: 1.0
Sender: tomelite82@gmail.com
Received: by 10.220.128.1 with SMTP id i1mr1939885vcs.87.1256112606315; Wed, 
	21 Oct 2009 01:10:06 -0700 (PDT)
In-Reply-To: 
References: <200910201755.n9KHtgT9073966@svn.freebsd.org>
	
Date: Wed, 21 Oct 2009 01:10:06 -0700
X-Google-Sender-Auth: 0de68eb80a7b8ec2
Message-ID: <9ace436c0910210110gc359cd1jea3dbd49db7e8733@mail.gmail.com>
From: Qing Li 
To: Robert Watson 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198301 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 08:10:07 -0000

I believe this patch will fix your crash.

-- Qing


On Wed, Oct 21, 2009 at 12:58 AM, Robert Watson  wrote=
:
> On Tue, 20 Oct 2009, Qing Li wrote:
>
>> =A0In the ARP callout timer expiration function, the current time_second
>> =A0is compared against the entry expiration time value (that was set bas=
ed
>> =A0on time_second) to check if the current time is larger than the set
>> =A0expiration time. Due to the +/- timer granularity value, the comparis=
on
>> =A0returns false, causing the alternative code to be executed. The
>> =A0alternative code path freed the memory without removing that entry
>> =A0from the table list, causing a use-after-free bug.
>>
>> =A0Reviewed by: =A0 discussed with kmacy
>> =A0MFC after: =A0 =A0 immediately
>> =A0Verified by: =A0 rnoland, yongari
>
> Could this be the same problem I ran into overnight on an 18 October kern=
el:
>
> Fatal trap 12: page fault while in kernel mode
> cpuid =3D 0; apic id =3D 00
> fault virtual address =A0 =3D 0x7572749f
> fault code =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D supervisor read, page not prese=
nt
> instruction pointer =A0 =A0 =3D 0x20:0xc09c0551
> stack pointer =A0 =A0 =A0 =A0 =A0 =3D 0x28:0xc43f6ab4
> frame pointer =A0 =A0 =A0 =A0 =A0 =3D 0x28:0xc43f6adc
> code segment =A0 =A0 =A0 =A0 =A0 =A0=3D base 0x0, limit 0xfffff, type 0x1=
b
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D DPL 0, pres 1, def32 1=
, gran 1
> processor eflags =A0 =A0 =A0 =A0=3D interrupt enabled, resume, IOPL =3D 0
> current process =A0 =A0 =A0 =A0 =3D 0 (em0 taskq)
>
> #9 =A00xc0be731b in calltrap () at ../../../i386/i386/exception.s:165
> #10 0xc09c0551 in in_lltable_lookup (llt=3D0xc4955200, flags=3D8192,
> =A0 =A0l3addr=3D0xc43f6b60) at ../../../netinet/in.c:1361
> #11 0xc09b8ea7 in arpintr (m=3D0xc48dcd00) at if_llatbl.h:202
> #12 0xc096f899 in netisr_dispatch_src (proto=3D7, source=3D0, m=3D0xc48dc=
d00)
> =A0 =A0at ../../../net/netisr.c:917
> #13 0xc096fb30 in netisr_dispatch (proto=3D7, m=3D0xc48dcd00)
> =A0 =A0at ../../../net/netisr.c:1004
> #14 0xc0967c11 in ether_demux (ifp=3D0xc470b400, m=3D0xc48dcd00)
> =A0 =A0at ../../../net/if_ethersubr.c:895
> #15 0xc0968163 in ether_input (ifp=3D0xc470b400, m=3D0xc48dcd00)
> =A0 =A0at ../../../net/if_ethersubr.c:754
> #16 0xc063bcaa in em_rxeof (adapter=3D0xc470d000, count=3D99)
> =A0 =A0at ../../../dev/e1000/if_em.c:4610
> #17 0xc063dfc7 in em_handle_rxtx (context=3D0xc470d000, pending=3D1)
> =A0 =A0at ../../../dev/e1000/if_em.c:1763
>
> (kgdb) frame 10
> #10 0xc09c0551 in in_lltable_lookup (llt=3D0xc4955200, flags=3D8192,
> =A0 =A0l3addr=3D0xc43f6b60) at ../../../netinet/in.c:1361
> 1361 =A0 =A0 =A0 =A0 =A0 =A0LIST_FOREACH(lle, lleh, lle_next) {
> (kgdb) list
> 1356 =A0 =A0 =A0 =A0 =A0 =A0KASSERT(l3addr->sa_family =3D=3D AF_INET,
> 1357 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0("sin_family %d", l3addr->sa_family))=
;
> 1358
> 1359 =A0 =A0 =A0 =A0 =A0 =A0hashkey =3D sin->sin_addr.s_addr;
> 1360 =A0 =A0 =A0 =A0 =A0 =A0lleh =3D &llt->lle_head[LLATBL_HASH(hashkey, =
LLTBL_HASHMASK)];
> 1361 =A0 =A0 =A0 =A0 =A0 =A0LIST_FOREACH(lle, lleh, lle_next) {
> 1362 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct sockaddr_in *sa2 =3D (=
struct sockaddr_in
> *)L3_ADDR(lle);
> 1363 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (lle->la_flags & LLE_DELET=
ED)
> 1364 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;
> 1365 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (sa2->sin_addr.s_addr =3D=
=3D sin->sin_addr.s_addr)
> (kgdb) print *llt
> $5 =3D {llt_link =3D {sle_next =3D 0x0}, lle_head =3D {{lh_first =3D 0xc7=
60d580}, {
> =A0 =A0 =A0lh_first =3D 0x0}, {lh_first =3D 0x0}, {lh_first =3D 0xc75c390=
0}, {
> =A0 =A0 =A0lh_first =3D 0x0} , {lh_first =3D 0xc49a8380=
}, {
> =A0 =A0 =A0lh_first =3D 0x0}, {lh_first =3D 0x0}, {lh_first =3D 0x0}, {lh=
_first =3D 0x0},
> {
> =A0 =A0 =A0lh_first =3D 0x0}, {lh_first =3D 0x0}, {lh_first =3D 0x0}, {lh=
_first =3D 0x0},
> {
> =A0 =A0 =A0lh_first =3D 0x0}, {lh_first =3D 0xc61be780}, {lh_first =3D 0x=
0}, {
> =A0 =A0 =A0lh_first =3D 0x0}, {lh_first =3D 0x0}}, llt_af =3D 2, llt_ifp =
=3D 0xc470b400,
> =A0llt_new =3D 0xc09bdd60 ,
> =A0llt_free =3D 0xc09c0490 ,
> =A0llt_prefix_free =3D 0xc09c09b0 ,
> =A0llt_lookup =3D 0xc09c0510 ,
> =A0llt_rtcheck =3D 0xc09bdbe0 ,
> =A0llt_dump =3D 0xc09bd9c0 }
> (kgdb) print *l3addr
> $6 =3D {sa_len =3D 16 '\020', sa_family =3D 2 '\002',
> =A0sa_data =3D "\000\000??*\001\000\000\000\000\000\000\000"}
> (kgdb) print lle
> $7 =3D (struct llentry *) 0x75727473
> (kgdb) print lleh
> $8 =3D (struct llentries *) 0xc4955210
> (kgdb) print *lleh
> $9 =3D {lh_first =3D 0xc75c3900}
>
> Your commit was after this kernel, so I'd be quite happy with the answer
> "now fixed" but wanted to be sure.
>
> Robert
>
>>
>> Modified:
>> =A0head/sys/netinet/if_ether.c
>>
>> Modified: head/sys/netinet/if_ether.c
>>
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/netinet/if_ether.c Tue Oct 20 17:50:36 2009 =A0 =A0 =A0 =A0=
(r198300)
>> +++ head/sys/netinet/if_ether.c Tue Oct 20 17:55:42 2009 =A0 =A0 =A0 =A0=
(r198301)
>> @@ -175,18 +175,18 @@ arptimer(void *arg)
>> =A0 =A0 =A0 =A0CURVNET_SET(ifp->if_vnet);
>> =A0 =A0 =A0 =A0IF_AFDATA_LOCK(ifp);
>> =A0 =A0 =A0 =A0LLE_WLOCK(lle);
>> - =A0 =A0 =A0 if (((lle->la_flags & LLE_DELETED) ||
>> - =A0 =A0 =A0 =A0 =A0 (time_second >=3D lle->la_expire)) &&
>> - =A0 =A0 =A0 =A0 =A0 (!callout_pending(&lle->la_timer) &&
>> + =A0 =A0 =A0 if ((!callout_pending(&lle->la_timer) &&
>> =A0 =A0 =A0 =A0 =A0 =A0callout_active(&lle->la_timer))) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(void) llentry_free(lle);
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ARPSTAT_INC(timeouts);
>> - =A0 =A0 =A0 } else {
>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Still valid, just drop our reference
>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 LLE_FREE_LOCKED(lle);
>> + =A0 =A0 =A0 }
>> +#ifdef DIAGNOSTICS
>> + =A0 =A0 =A0 else {
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct sockaddr *l3addr =3D L3_ADDR(lle);
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 log(LOG_INFO, "arptimer issue: %p, IPv4 ad=
dress:
>> \"%s\"\n", lle,
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 inet_ntoa(((const struct sockaddr_=
in
>> *)l3addr)->sin_addr));
>> =A0 =A0 =A0 =A0}
>> +#endif
>> =A0 =A0 =A0 =A0IF_AFDATA_UNLOCK(ifp);
>> =A0 =A0 =A0 =A0CURVNET_RESTORE();
>> }
>> @@ -377,7 +377,7 @@ retry:
>>
>> =A0 =A0 =A0 =A0if (renew) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LLE_ADDREF(la);
>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 la->la_expire =3D time_second;
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 la->la_expire =3D time_second + V_arpt_dow=
n;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0callout_reset(&la->la_timer, hz * V_arpt_=
down, arptimer,
>> la);
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0la->la_asked++;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0LLE_WUNLOCK(la);
>>
>

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 08:27:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E26B9106566C;
	Wed, 21 Oct 2009 08:27:28 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id A30078FC16;
	Wed, 21 Oct 2009 08:27:28 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 4ECEF46B45;
	Wed, 21 Oct 2009 04:27:28 -0400 (EDT)
Date: Wed, 21 Oct 2009 09:27:28 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Qing Li 
In-Reply-To: <9ace436c0910210110gc359cd1jea3dbd49db7e8733@mail.gmail.com>
Message-ID: 
References: <200910201755.n9KHtgT9073966@svn.freebsd.org>
	
	<9ace436c0910210110gc359cd1jea3dbd49db7e8733@mail.gmail.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-69947553-1256113648=:24137"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198301 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 08:27:29 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--621616949-69947553-1256113648=:24137
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 21 Oct 2009, Qing Li wrote:

> I believe this patch will fix your crash.

Sounds good, thanks!

Robert


>
> -- Qing
>
>
> On Wed, Oct 21, 2009 at 12:58 AM, Robert Watson  wrote:
>> On Tue, 20 Oct 2009, Qing Li wrote:
>>
>>>  In the ARP callout timer expiration function, the current time_second
>>>  is compared against the entry expiration time value (that was set based
>>>  on time_second) to check if the current time is larger than the set
>>>  expiration time. Due to the +/- timer granularity value, the comparison
>>>  returns false, causing the alternative code to be executed. The
>>>  alternative code path freed the memory without removing that entry
>>>  from the table list, causing a use-after-free bug.
>>>
>>>  Reviewed by:   discussed with kmacy
>>>  MFC after:     immediately
>>>  Verified by:   rnoland, yongari
>>
>> Could this be the same problem I ran into overnight on an 18 October kernel:
>>
>> Fatal trap 12: page fault while in kernel mode
>> cpuid = 0; apic id = 00
>> fault virtual address   = 0x7572749f
>> fault code              = supervisor read, page not present
>> instruction pointer     = 0x20:0xc09c0551
>> stack pointer           = 0x28:0xc43f6ab4
>> frame pointer           = 0x28:0xc43f6adc
>> code segment            = base 0x0, limit 0xfffff, type 0x1b
>>                        = DPL 0, pres 1, def32 1, gran 1
>> processor eflags        = interrupt enabled, resume, IOPL = 0
>> current process         = 0 (em0 taskq)
>>
>> #9  0xc0be731b in calltrap () at ../../../i386/i386/exception.s:165
>> #10 0xc09c0551 in in_lltable_lookup (llt=0xc4955200, flags=8192,
>>    l3addr=0xc43f6b60) at ../../../netinet/in.c:1361
>> #11 0xc09b8ea7 in arpintr (m=0xc48dcd00) at if_llatbl.h:202
>> #12 0xc096f899 in netisr_dispatch_src (proto=7, source=0, m=0xc48dcd00)
>>    at ../../../net/netisr.c:917
>> #13 0xc096fb30 in netisr_dispatch (proto=7, m=0xc48dcd00)
>>    at ../../../net/netisr.c:1004
>> #14 0xc0967c11 in ether_demux (ifp=0xc470b400, m=0xc48dcd00)
>>    at ../../../net/if_ethersubr.c:895
>> #15 0xc0968163 in ether_input (ifp=0xc470b400, m=0xc48dcd00)
>>    at ../../../net/if_ethersubr.c:754
>> #16 0xc063bcaa in em_rxeof (adapter=0xc470d000, count=99)
>>    at ../../../dev/e1000/if_em.c:4610
>> #17 0xc063dfc7 in em_handle_rxtx (context=0xc470d000, pending=1)
>>    at ../../../dev/e1000/if_em.c:1763
>>
>> (kgdb) frame 10
>> #10 0xc09c0551 in in_lltable_lookup (llt=0xc4955200, flags=8192,
>>    l3addr=0xc43f6b60) at ../../../netinet/in.c:1361
>> 1361            LIST_FOREACH(lle, lleh, lle_next) {
>> (kgdb) list
>> 1356            KASSERT(l3addr->sa_family == AF_INET,
>> 1357                ("sin_family %d", l3addr->sa_family));
>> 1358
>> 1359            hashkey = sin->sin_addr.s_addr;
>> 1360            lleh = &llt->lle_head[LLATBL_HASH(hashkey, LLTBL_HASHMASK)];
>> 1361            LIST_FOREACH(lle, lleh, lle_next) {
>> 1362                    struct sockaddr_in *sa2 = (struct sockaddr_in
>> *)L3_ADDR(lle);
>> 1363                    if (lle->la_flags & LLE_DELETED)
>> 1364                            continue;
>> 1365                    if (sa2->sin_addr.s_addr == sin->sin_addr.s_addr)
>> (kgdb) print *llt
>> $5 = {llt_link = {sle_next = 0x0}, lle_head = {{lh_first = 0xc760d580}, {
>>      lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0xc75c3900}, {
>>      lh_first = 0x0} , {lh_first = 0xc49a8380}, {
>>      lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0},
>> {
>>      lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0},
>> {
>>      lh_first = 0x0}, {lh_first = 0xc61be780}, {lh_first = 0x0}, {
>>      lh_first = 0x0}, {lh_first = 0x0}}, llt_af = 2, llt_ifp = 0xc470b400,
>>  llt_new = 0xc09bdd60 ,
>>  llt_free = 0xc09c0490 ,
>>  llt_prefix_free = 0xc09c09b0 ,
>>  llt_lookup = 0xc09c0510 ,
>>  llt_rtcheck = 0xc09bdbe0 ,
>>  llt_dump = 0xc09bd9c0 }
>> (kgdb) print *l3addr
>> $6 = {sa_len = 16 '\020', sa_family = 2 '\002',
>>  sa_data = "\000\000??*\001\000\000\000\000\000\000\000"}
>> (kgdb) print lle
>> $7 = (struct llentry *) 0x75727473
>> (kgdb) print lleh
>> $8 = (struct llentries *) 0xc4955210
>> (kgdb) print *lleh
>> $9 = {lh_first = 0xc75c3900}
>>
>> Your commit was after this kernel, so I'd be quite happy with the answer
>> "now fixed" but wanted to be sure.
>>
>> Robert
>>
>>>
>>> Modified:
>>>  head/sys/netinet/if_ether.c
>>>
>>> Modified: head/sys/netinet/if_ether.c
>>>
>>> ==============================================================================
>>> --- head/sys/netinet/if_ether.c Tue Oct 20 17:50:36 2009        (r198300)
>>> +++ head/sys/netinet/if_ether.c Tue Oct 20 17:55:42 2009        (r198301)
>>> @@ -175,18 +175,18 @@ arptimer(void *arg)
>>>        CURVNET_SET(ifp->if_vnet);
>>>        IF_AFDATA_LOCK(ifp);
>>>        LLE_WLOCK(lle);
>>> -       if (((lle->la_flags & LLE_DELETED) ||
>>> -           (time_second >= lle->la_expire)) &&
>>> -           (!callout_pending(&lle->la_timer) &&
>>> +       if ((!callout_pending(&lle->la_timer) &&
>>>            callout_active(&lle->la_timer))) {
>>>                (void) llentry_free(lle);
>>>                ARPSTAT_INC(timeouts);
>>> -       } else {
>>> -               /*
>>> -                * Still valid, just drop our reference
>>> -                */
>>> -               LLE_FREE_LOCKED(lle);
>>> +       }
>>> +#ifdef DIAGNOSTICS
>>> +       else {
>>> +               struct sockaddr *l3addr = L3_ADDR(lle);
>>> +               log(LOG_INFO, "arptimer issue: %p, IPv4 address:
>>> \"%s\"\n", lle,
>>> +                   inet_ntoa(((const struct sockaddr_in
>>> *)l3addr)->sin_addr));
>>>        }
>>> +#endif
>>>        IF_AFDATA_UNLOCK(ifp);
>>>        CURVNET_RESTORE();
>>> }
>>> @@ -377,7 +377,7 @@ retry:
>>>
>>>        if (renew) {
>>>                LLE_ADDREF(la);
>>> -               la->la_expire = time_second;
>>> +               la->la_expire = time_second + V_arpt_down;
>>>                callout_reset(&la->la_timer, hz * V_arpt_down, arptimer,
>>> la);
>>>                la->la_asked++;
>>>                LLE_WUNLOCK(la);
>>>
>>
>
--621616949-69947553-1256113648=:24137--

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 09:22:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA57B1065676;
	Wed, 21 Oct 2009 09:22:41 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 986678FC15;
	Wed, 21 Oct 2009 09:22:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9L9MflK093317;
	Wed, 21 Oct 2009 09:22:41 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9L9MfJw093316;
	Wed, 21 Oct 2009 09:22:41 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910210922.n9L9MfJw093316@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 21 Oct 2009 09:22:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198313 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 09:22:42 -0000

Author: brueffer
Date: Wed Oct 21 09:22:40 2009
New Revision: 198313
URL: http://svn.freebsd.org/changeset/base/198313

Log:
  Improve the description of the malofw kernel module installation.
  
  PR:		132193
  Submitted by:	Frank Staals 
  Based on a patch by: gavin
  MFC after:	3 days

Modified:
  head/share/man/man4/malo.4

Modified: head/share/man/man4/malo.4
==============================================================================
--- head/share/man/man4/malo.4	Wed Oct 21 04:35:09 2009	(r198312)
+++ head/share/man/man4/malo.4	Wed Oct 21 09:22:40 2009	(r198313)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd March 26, 2009
+.Dd October 21, 2009
 .Dt MALO 4
 .Os
 .Sh NAME
@@ -71,14 +71,19 @@ For more information on configuring this
 .Pp
 This driver requires the
 .Nm malofw
-be installed before it will work.
+firmware kernel module be installed before it will work.
 The firmware files are not publicly available.
-A package of the firmware which can be installed via
-.Xr pkg_add 1
-with:
+A port of the firmware can be found at:
 .Bd -literal -offset indent
 http://weongyo.org/project/malo/malo-firmware-1.4.tar.gz
 .Ed
+.Pp
+The firmware kernel module can be installed by extracting
+the archive and running
+.Ql make install clean
+in the
+.Pa malo-firmware-1.4
+directory.
 .Sh HARDWARE
 The following cards are among those supported by the
 .Nm

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 09:43:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 441AA1065670;
	Wed, 21 Oct 2009 09:43:23 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 33D0A8FC17;
	Wed, 21 Oct 2009 09:43:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9L9hNFn093731;
	Wed, 21 Oct 2009 09:43:23 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9L9hNpA093729;
	Wed, 21 Oct 2009 09:43:23 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910210943.n9L9hNpA093729@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 21 Oct 2009 09:43:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198314 - head/etc/defaults
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 09:43:23 -0000

Author: brueffer
Date: Wed Oct 21 09:43:22 2009
New Revision: 198314
URL: http://svn.freebsd.org/changeset/base/198314

Log:
  Add empty watchdogd_flags.
  
  PR:		136620
  Submitted by:	amdmi3
  MFC after:	3 days

Modified:
  head/etc/defaults/rc.conf

Modified: head/etc/defaults/rc.conf
==============================================================================
--- head/etc/defaults/rc.conf	Wed Oct 21 09:22:40 2009	(r198313)
+++ head/etc/defaults/rc.conf	Wed Oct 21 09:43:22 2009	(r198314)
@@ -600,6 +600,7 @@ harvest_ethernet="YES"	# Entropy device 
 harvest_p_to_p="YES"	# Entropy device harvests point-to-point randomness
 dmesg_enable="YES"	# Save dmesg(8) to /var/run/dmesg.boot
 watchdogd_enable="NO"	# Start the software watchdog daemon
+watchdogd_flags=""	# Flags to watchdogd (if enabled)
 devfs_rulesets="/etc/defaults/devfs.rules /etc/devfs.rules" # Files containing
 							    # devfs(8) rules.
 devfs_system_ruleset=""	# The name (NOT number) of a ruleset to apply to /dev

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 10:15:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89C25106566B;
	Wed, 21 Oct 2009 10:15:26 +0000 (UTC)
	(envelope-from remko@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 798DD8FC16;
	Wed, 21 Oct 2009 10:15:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LAFQ6q094534;
	Wed, 21 Oct 2009 10:15:26 GMT (envelope-from remko@svn.freebsd.org)
Received: (from remko@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LAFQwY094532;
	Wed, 21 Oct 2009 10:15:26 GMT (envelope-from remko@svn.freebsd.org)
Message-Id: <200910211015.n9LAFQwY094532@svn.freebsd.org>
From: Remko Lodder 
Date: Wed, 21 Oct 2009 10:15:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 10:15:26 -0000

Author: remko
Date: Wed Oct 21 10:15:26 2009
New Revision: 198316
URL: http://svn.freebsd.org/changeset/base/198316

Log:
  The tunefs utility does not work on active filesystems.
  
  PR:		docs/139705
  Submitted by:	Warren Block 
  Approved by:	imp (mentor, implicit)

Modified:
  head/sbin/tunefs/tunefs.8

Modified: head/sbin/tunefs/tunefs.8
==============================================================================
--- head/sbin/tunefs/tunefs.8	Wed Oct 21 09:53:55 2009	(r198315)
+++ head/sbin/tunefs/tunefs.8	Wed Oct 21 10:15:26 2009	(r198316)
@@ -28,7 +28,7 @@
 .\"     @(#)tunefs.8	8.2 (Berkeley) 12/11/93
 .\" $FreeBSD$
 .\"
-.Dd August 13, 2007
+.Dd October 21, 2009
 .Dt TUNEFS 8
 .Os
 .Sh NAME
@@ -165,7 +165,7 @@ The
 utility appeared in
 .Bx 4.2 .
 .Sh BUGS
-This utility should work on active file systems.
+This utility does not work on active file systems.
 To change the root file system, the system must be rebooted
 after the file system is tuned.
 .\" Take this out and a Unix Daemon will dog your steps from now until

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 11:10:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C13CB1065693;
	Wed, 21 Oct 2009 11:10:34 +0000 (UTC)
	(envelope-from rink@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B05D98FC27;
	Wed, 21 Oct 2009 11:10:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LBAYhc097428;
	Wed, 21 Oct 2009 11:10:34 GMT (envelope-from rink@svn.freebsd.org)
Received: (from rink@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LBAYG6097426;
	Wed, 21 Oct 2009 11:10:34 GMT (envelope-from rink@svn.freebsd.org)
Message-Id: <200910211110.n9LBAYG6097426@svn.freebsd.org>
From: Rink Springer 
Date: Wed, 21 Oct 2009 11:10:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198317 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 11:10:34 -0000

Author: rink
Date: Wed Oct 21 11:10:34 2009
New Revision: 198317
URL: http://svn.freebsd.org/changeset/base/198317

Log:
  Introduce 'netDev=ANY' support for scripted (install.cfg) installs, which results in the first ethernet interface with physical link being selected.
  
  While here, fix a minor typo causing an 'if' to be missed.
  
  Submitted by:	randi

Modified:
  head/usr.sbin/sysinstall/tcpip.c

Modified: head/usr.sbin/sysinstall/tcpip.c
==============================================================================
--- head/usr.sbin/sysinstall/tcpip.c	Wed Oct 21 10:15:26 2009	(r198316)
+++ head/usr.sbin/sysinstall/tcpip.c	Wed Oct 21 11:10:34 2009	(r198317)
@@ -40,10 +40,17 @@
 #include "sysinstall.h"
 #include 
 #include 
+#include 
 #include 
+#include 
+
 #include 
+#include 
+#include 
+
 #include 
 #include 
+#include 
 
 /* The help file for the TCP/IP setup screen */
 #define TCP_HELPFILE		"tcp"
@@ -636,6 +643,51 @@ netHook(dialogMenuItem *self)
     return devs ? DITEM_LEAVE_MENU : DITEM_FAILURE;
 }
 
+static char *
+tcpDeviceScan(void)
+{
+	int s;
+	struct ifmediareq ifmr;
+	struct ifaddrs *ifap, *ifa;
+	struct if_data *ifd;
+	char *network_dev;
+
+	if ((s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0)
+		return (NULL);
+
+	if (getifaddrs(&ifap) < 0)
+		return (NULL);
+
+	for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
+		memset(&ifmr, 0, sizeof(ifmr));
+		strlcpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
+
+		if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0)
+			continue;	/* some devices don't support this */ 
+
+		if ((ifmr.ifm_status & IFM_AVALID) == 0)
+			continue;	/* not active */
+
+		if (IFM_TYPE(ifmr.ifm_active) != IFM_ETHER)
+			continue;	/* not an ethernet device */
+
+		if (ifmr.ifm_status & IFM_ACTIVE) {
+			network_dev = strdup(ifa->ifa_name);
+			freeifaddrs(ifap);
+
+			if (!variable_get(VAR_NONINTERACTIVE)) 
+				msgConfirm("Using interface %s", network_dev);
+
+			msgDebug("tcpDeviceScan found %s", network_dev);
+			return (network_dev);
+		}
+	}
+
+	freeifaddrs(ifap);
+
+	return (NULL);
+}
+
 /* Get a network device */
 Device *
 tcpDeviceSelect(void)
@@ -647,27 +699,38 @@ tcpDeviceSelect(void)
 
     rval = NULL;
 
-    if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) {
+    if (variable_get(VAR_NETWORK_DEVICE)) {
 	network_dev = variable_get(VAR_NETWORK_DEVICE);
 
+	/* 
+	 * netDev can be set to several types of values.
+	 * If netDev is set to ANY, scan all network devices
+	 * looking for a valid link, and go with the first
+	 * device found. netDev can also be specified as a
+	 * comma delimited list, with each network device
+	 * tried in order. netDev can also be set to a single
+	 * network device.
+	 */
+	if (!strcmp(network_dev, "ANY")) 
+		network_dev = strdup(tcpDeviceScan()); 
+
 	while ((dev = strsep(&network_dev, ",")) != NULL) {
 	    devs = deviceFind(dev, DEVICE_TYPE_NETWORK);
 	    cnt = deviceCount(devs);
+
 	    if (cnt) {
-		if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS))
-		    return(devs[0]);
+		if (DITEM_STATUS(tcpOpenDialog(devs[0])) == DITEM_SUCCESS) 
+		    return (devs[0]);
 	    }
 	}
-    }
 
-    devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK);
-    cnt = deviceCount(devs);
+	if (!variable_get(VAR_NONINTERACTIVE))
+		msgConfirm("No network devices available!");
 
-    if (!cnt) {
-	msgConfirm("No network devices available!");
-	return NULL;
+	return (NULL);
     }
-    else if ((!RunningAsInit) && (variable_check("NETWORK_CONFIGURED=NO") != TRUE)) {
+
+    if ((!RunningAsInit) && (variable_check("NETWORK_CONFIGURED=NO") != TRUE)) {
 	if (!msgYesNo("Running multi-user, assume that the network is already configured?"))
 	    return devs[0];
     }

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 11:29:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4121C1065679;
	Wed, 21 Oct 2009 11:29:12 +0000 (UTC)
	(envelope-from ivoras@gmail.com)
Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26])
	by mx1.freebsd.org (Postfix) with ESMTP id 5391D8FC2B;
	Wed, 21 Oct 2009 11:29:10 +0000 (UTC)
Received: by ey-out-2122.google.com with SMTP id 9so1460986eyd.9
	for ; Wed, 21 Oct 2009 04:29:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:from:date:x-google-sender-auth:message-id:subject:to:cc
	:content-type:content-transfer-encoding;
	bh=CUeoCddblzDT3HF89yQ2bEE3lDYQuLD3bjJaOY/K1SQ=;
	b=SXQ4DE8Q9GHo8wcbKUG8sNRVwCCqyBIfoN7fp7X9uM5l3uuwewwVRfk0eGjstuVVu6
	c1OvUfoMwZYTFrc3ufHEGBrscfLvxQNFwYGALjGn0VHeIwL/z25xH4HldvFLiczg6Fcn
	J0kCxxHRO/69pqK8r2j81/M38aIGlZyzdqDLA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:from:date
	:x-google-sender-auth:message-id:subject:to:cc:content-type
	:content-transfer-encoding;
	b=qpfnGhi/6bAGqGI/lQeJxL7FJoEh8/4SI8VqPFwX2gzt28POlfZpBJN6OKcHXb7GqJ
	14h8QVWrJZTKn9YXLhMiRL0z4NCwEZlDNlEzCsGxgDPBO+SsYQQVtdbiybXUloKMyNKb
	6l2qEJhz2UWk7jSB263siRDkQ4QsiwYkj9Zk4=
MIME-Version: 1.0
Sender: ivoras@gmail.com
Received: by 10.216.87.131 with SMTP id y3mr2770134wee.9.1256124550166; Wed, 
	21 Oct 2009 04:29:10 -0700 (PDT)
In-Reply-To: <200910211015.n9LAFQwY094532@svn.freebsd.org>
References: <200910211015.n9LAFQwY094532@svn.freebsd.org>
From: Ivan Voras 
Date: Wed, 21 Oct 2009 13:28:50 +0200
X-Google-Sender-Auth: 464de400b2f438f4
Message-ID: <9bbcef730910210428i4b39b358sbcfb76d882a4c24a@mail.gmail.com>
To: Remko Lodder 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 11:29:12 -0000

2009/10/21 Remko Lodder :
> Author: remko
> Date: Wed Oct 21 10:15:26 2009
> New Revision: 198316
> URL: http://svn.freebsd.org/changeset/base/198316
>
> Log:
> =C2=A0The tunefs utility does not work on active filesystems.

> =C2=A0.Sh BUGS
> -This utility should work on active file systems.
> +This utility does not work on active file systems.
> =C2=A0To change the root file system, the system must be rebooted
> =C2=A0after the file system is tuned.

Hmm, if it doesn't work on active file system, there is no way to
change the root file system :)

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 11:50:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3E7D10656A6;
	Wed, 21 Oct 2009 11:50:18 +0000 (UTC)
	(envelope-from stas@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C8F218FC26;
	Wed, 21 Oct 2009 11:50:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LBoIZD098323;
	Wed, 21 Oct 2009 11:50:18 GMT (envelope-from stas@svn.freebsd.org)
Received: (from stas@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LBoI05098322;
	Wed, 21 Oct 2009 11:50:18 GMT (envelope-from stas@svn.freebsd.org)
Message-Id: <200910211150.n9LBoI05098322@svn.freebsd.org>
From: Stanislav Sedov 
Date: Wed, 21 Oct 2009 11:50:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198318 - head/sys/dev/bge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 11:50:19 -0000

Author: stas
Date: Wed Oct 21 11:50:18 2009
New Revision: 198318
URL: http://svn.freebsd.org/changeset/base/198318

Log:
  - On entrance to the rx_eof sync RX rings maps with POSTWRITE flag
    instead of POSTREAD: the hardware do not touch this memory (CPU
    updates it).  It is already synchronized as PREWRITE after the
    processing is done.
  
  - Synchronize RX return ring memory in rx_eof.  This is needed
    as the deviced updates this memory when receives packets.
  
  - Decouple the synchronization of BGE status block in the interrupt
    service routine: perfrom PREREAD synchronization only all accesses
    to this block are finished.  This seems to be more natural.
  
  Reviewed by:	yongari, marius
  MFC after:	2 weeks

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Wed Oct 21 11:10:34 2009	(r198317)
+++ head/sys/dev/bge/if_bge.c	Wed Oct 21 11:50:18 2009	(r198318)
@@ -3122,10 +3122,10 @@ bge_rxeof(struct bge_softc *sc)
 	bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag,
 	    sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD);
 	bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag,
-	    sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTREAD);
+	    sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE);
 	if (BGE_IS_JUMBO_CAPABLE(sc))
 		bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag,
-		    sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTREAD);
+		    sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE);
 
 	while (rx_cons != rx_prod) {
 		struct bge_rx_bd	*cur_rx;
@@ -3251,6 +3251,8 @@ bge_rxeof(struct bge_softc *sc)
 			return (rx_npkts);
 	}
 
+	bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag,
+	    sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_PREREAD);
 	if (stdcnt > 0)
 		bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag,
 		    sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE);
@@ -3423,8 +3425,6 @@ bge_intr(void *xsc)
 	/* Make sure the descriptor ring indexes are coherent. */
 	bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
 	    sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD);
-	bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
-	    sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD);
 
 	if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 &&
 	    sc->bge_chipid != BGE_CHIPID_BCM5700_B2) ||
@@ -3445,6 +3445,9 @@ bge_intr(void *xsc)
 	    !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 		bge_start_locked(ifp);
 
+	bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
+	    sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD);
+
 	BGE_UNLOCK(sc);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 11:53:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 555C7106566B;
	Wed, 21 Oct 2009 11:53:21 +0000 (UTC)
	(envelope-from remko@elvandar.org)
Received: from mailgate.jr-hosting.nl (mailgate.jr-hosting.nl [78.46.126.30])
	by mx1.freebsd.org (Postfix) with ESMTP id 0E3F58FC20;
	Wed, 21 Oct 2009 11:53:20 +0000 (UTC)
Received: from websrv01.jr-hosting.nl (websrv01 [78.47.69.233])
	by mailgate.jr-hosting.nl (Postfix) with ESMTP id 003871CD26;
	Wed, 21 Oct 2009 13:53:19 +0200 (CEST)
Received: from dolgan.elvandar.org ([78.47.44.218] helo=[10.0.3.2])
	by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1N0Zkk-000C7k-TP; Wed, 21 Oct 2009 13:53:18 +0200
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
From: Remko Lodder 
In-Reply-To: <9bbcef730910210428i4b39b358sbcfb76d882a4c24a@mail.gmail.com>
Date: Wed, 21 Oct 2009 13:53:16 +0200
Content-Transfer-Encoding: 7bit
Message-Id: <37F1A0B7-AB2D-40DD-9C37-917C21D48ADA@elvandar.org>
References: <200910211015.n9LAFQwY094532@svn.freebsd.org>
	<9bbcef730910210428i4b39b358sbcfb76d882a4c24a@mail.gmail.com>
To: Ivan Voras 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, Remko Lodder ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 11:53:21 -0000

On Oct 21, 2009, at 1:28 PM, Ivan Voras wrote:

> 2009/10/21 Remko Lodder :
>> Author: remko
>> Date: Wed Oct 21 10:15:26 2009
>> New Revision: 198316
>> URL: http://svn.freebsd.org/changeset/base/198316
>>
>> Log:
>>  The tunefs utility does not work on active filesystems.
>
>>  .Sh BUGS
>> -This utility should work on active file systems.
>> +This utility does not work on active file systems.
>>  To change the root file system, the system must be rebooted
>>  after the file system is tuned.
>
> Hmm, if it doesn't work on active file system, there is no way to
> change the root file system :)

That can be, but last time I tried this myself, I walked into the  
problem as well..

-- 
/"\   Best regards,                        | remko@FreeBSD.org
\ /   Remko Lodder                      | remko@EFnet
X    http://www.evilcoder.org/    |
/ \   ASCII Ribbon Campaign    | Against HTML Mail and News


From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 11:55:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF9731065672;
	Wed, 21 Oct 2009 11:55:56 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
	by mx1.freebsd.org (Postfix) with ESMTP id 1C2C78FC19;
	Wed, 21 Oct 2009 11:55:54 +0000 (UTC)
Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua
	[212.40.38.101])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA21652;
	Wed, 21 Oct 2009 14:55:52 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Message-ID: <4ADEF6C8.3060808@freebsd.org>
Date: Wed, 21 Oct 2009 14:55:52 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.23 (X11/20090825)
MIME-Version: 1.0
To: Ivan Voras 
References: <200910211015.n9LAFQwY094532@svn.freebsd.org>
	<9bbcef730910210428i4b39b358sbcfb76d882a4c24a@mail.gmail.com>
In-Reply-To: <9bbcef730910210428i4b39b358sbcfb76d882a4c24a@mail.gmail.com>
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, Remko Lodder ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 11:55:56 -0000

on 21/10/2009 14:28 Ivan Voras said the following:
> 2009/10/21 Remko Lodder :
>> Author: remko
>> Date: Wed Oct 21 10:15:26 2009
>> New Revision: 198316
>> URL: http://svn.freebsd.org/changeset/base/198316
>>
>> Log:
>>  The tunefs utility does not work on active filesystems.
> 
>>  .Sh BUGS
>> -This utility should work on active file systems.
>> +This utility does not work on active file systems.
>>  To change the root file system, the system must be rebooted
>>  after the file system is tuned.
> 
> Hmm, if it doesn't work on active file system, there is no way to
> change the root file system :)

Booting with alternative root (possibly from alternative media)?

-- 
Andriy Gapon

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 12:19:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC9E41065697;
	Wed, 21 Oct 2009 12:19:56 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au
	[211.29.132.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 1C8218FC0C;
	Wed, 21 Oct 2009 12:19:55 +0000 (UTC)
Received: from c122-106-156-249.carlnfd1.nsw.optusnet.com.au
	(c122-106-156-249.carlnfd1.nsw.optusnet.com.au [122.106.156.249])
	by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n9LCJqDU026987
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 21 Oct 2009 23:19:53 +1100
Date: Wed, 21 Oct 2009 23:19:51 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Remko Lodder 
In-Reply-To: <200910211015.n9LAFQwY094532@svn.freebsd.org>
Message-ID: <20091021222805.I12783@delplex.bde.org>
References: <200910211015.n9LAFQwY094532@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 12:19:56 -0000

On Wed, 21 Oct 2009, Remko Lodder wrote:

> Log:
>  The tunefs utility does not work on active filesystems.

Er, that's what it already said.  Now it says less.  Except, it is
implicit in the statement being in the BUGS section that it is a bug
for tunefs to not work on active file systems, just like it used to
be implicit that tunefs did not work on active file systems.

> Modified: head/sbin/tunefs/tunefs.8
> ==============================================================================
> --- head/sbin/tunefs/tunefs.8	Wed Oct 21 09:53:55 2009	(r198315)
> +++ head/sbin/tunefs/tunefs.8	Wed Oct 21 10:15:26 2009	(r198316)
> @@ -28,7 +28,7 @@
> .\"     @(#)tunefs.8	8.2 (Berkeley) 12/11/93
> .\" $FreeBSD$
> .\"
> -.Dd August 13, 2007
> +.Dd October 21, 2009

It should have worked (but did not) on August 13 2007 too.

> .Dt TUNEFS 8
> .Os
> .Sh NAME
> @@ -165,7 +165,7 @@ The
> utility appeared in
> .Bx 4.2 .
> .Sh BUGS
> -This utility should work on active file systems.
> +This utility does not work on active file systems.

It still should work (but does not).  Except, it does work in some cases...

> To change the root file system, the system must be rebooted
> after the file system is tuned.
> .\" Take this out and a Unix Daemon will dog your steps from now until

... this man page has not caught up with the changes in 1999 that
made tunefs work on active file systems that are mounted read-only,
or even with the 1995 changes that added -p (-p should work on active
file systems, and I think it always did).  So it is now literally wrong
to say that tunefs does not work at all on active file systems, while
saying that it should remains correct.  What actually works is just
undocumented for the second and misdocumented for the first.

Also, error handling for the cases that don't work is obscure.  Its
error message doesn't mention mounted file systems and now doesn't
even mention the EBUSY error at the failure point.  This is fixed in
my version.  I haven't touched the man page.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 12:42:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B869E1065694;
	Wed, 21 Oct 2009 12:42:25 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 918888FC1B;
	Wed, 21 Oct 2009 12:42:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LCgPtQ099288;
	Wed, 21 Oct 2009 12:42:25 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LCgPF9099285;
	Wed, 21 Oct 2009 12:42:25 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910211242.n9LCgPF9099285@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 21 Oct 2009 12:42:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198319 - head/sys/dev/ahci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 12:42:25 -0000

Author: mav
Date: Wed Oct 21 12:42:25 2009
New Revision: 198319
URL: http://svn.freebsd.org/changeset/base/198319

Log:
  MFp4:
  On error, freeze device queue, to allow periph driver to do proper recovery.
  Freeze SIM queue only in some cases, when it is needed to protect SIM.
  
  Implement better command timeout detection logic for non-queued commands.
  This fixes false positives when command with short timeout waiting for the
  long one. For example, when hald tastes CD during burning process.
  
  Read and clear SERR register on interrupt.

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ahci/ahci.h

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Wed Oct 21 11:50:18 2009	(r198318)
+++ head/sys/dev/ahci/ahci.c	Wed Oct 21 12:42:25 2009	(r198319)
@@ -866,15 +866,11 @@ ahci_slotsfree(device_t dev)
 }
 
 static void
-ahci_phy_check_events(device_t dev)
+ahci_phy_check_events(device_t dev, u_int32_t serr)
 {
 	struct ahci_channel *ch = device_get_softc(dev);
-	u_int32_t error = ATA_INL(ch->r_mem, AHCI_P_SERR);
 
-	/* Clear error bits/interrupt */
-	ATA_OUTL(ch->r_mem, AHCI_P_SERR, error);
-	/* If we have a connection event, deal with it */
-	if ((error & ATA_SE_PHY_CHANGED) && (ch->pm_level == 0)) {
+	if ((serr & ATA_SE_PHY_CHANGED) && (ch->pm_level == 0)) {
 		u_int32_t status = ATA_INL(ch->r_mem, AHCI_P_SSTS);
 		if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) &&
 		    ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) &&
@@ -944,7 +940,7 @@ ahci_ch_intr(void *data)
 {
 	device_t dev = (device_t)data;
 	struct ahci_channel *ch = device_get_softc(dev);
-	uint32_t istatus, sstatus, cstatus, sntf = 0, ok, err;
+	uint32_t istatus, sstatus, cstatus, serr = 0, sntf = 0, ok, err;
 	enum ahci_err_type et;
 	int i, ccs, ncq_err = 0;
 
@@ -959,14 +955,20 @@ ahci_ch_intr(void *data)
 	if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF))
 		sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF);
 	/* Process PHY events */
-	if (istatus & (AHCI_P_IX_PRC | AHCI_P_IX_PC))
-		ahci_phy_check_events(dev);
+	if (istatus & (AHCI_P_IX_PC | AHCI_P_IX_PRC | AHCI_P_IX_OF |
+	    AHCI_P_IX_IF | AHCI_P_IX_HBD | AHCI_P_IX_HBF | AHCI_P_IX_TFE)) {
+		serr = ATA_INL(ch->r_mem, AHCI_P_SERR);
+		if (serr) {
+			ATA_OUTL(ch->r_mem, AHCI_P_SERR, serr);
+			ahci_phy_check_events(dev, serr);
+		}
+	}
 	/* Process command errors */
-	if (istatus & (AHCI_P_IX_IF | AHCI_P_IX_HBD | AHCI_P_IX_HBF |
-		       AHCI_P_IX_TFE | AHCI_P_IX_OF)) {
+	if (istatus & (AHCI_P_IX_OF | AHCI_P_IX_IF |
+	    AHCI_P_IX_HBD | AHCI_P_IX_HBF | AHCI_P_IX_TFE)) {
 //device_printf(dev, "%s ERROR is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n",
 //    __func__, istatus, cstatus, sstatus, ch->rslots, ATA_INL(ch->r_mem, AHCI_P_TFD),
-//    ATA_INL(ch->r_mem, AHCI_P_SERR));
+//    serr);
 		ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK)
 		    >> AHCI_P_CMD_CCS_SHIFT;
 		err = ch->rslots & (cstatus | sstatus);
@@ -985,19 +987,26 @@ ahci_ch_intr(void *data)
 	}
 	/* On error, complete the rest of commands with error statuses. */
 	if (err) {
-		if (!ch->readlog)
-			xpt_freeze_simq(ch->sim, ch->numrslots);
 		if (ch->frozen) {
 			union ccb *fccb = ch->frozen;
 			ch->frozen = NULL;
 			fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+			if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) {
+				xpt_freeze_devq(fccb->ccb_h.path, 1);
+				fccb->ccb_h.status |= CAM_DEV_QFRZN;
+			}
 			xpt_done(fccb);
 		}
 		for (i = 0; i < ch->numslots; i++) {
 			/* XXX: reqests in loading state. */
 			if (((err >> i) & 1) == 0)
 				continue;
-			if (istatus & AHCI_P_IX_TFE) {
+			if (istatus & AHCI_P_IX_IF) {
+				if (ch->numtslots == 0 && i != ccs)
+					et = AHCI_ERR_INNOCENT;
+				else
+					et = AHCI_ERR_SATA;
+			} else if (istatus & AHCI_P_IX_TFE) {
 				/* Task File Error */
 				if (ch->numtslots == 0) {
 					/* Untagged operation. */
@@ -1010,9 +1019,6 @@ ahci_ch_intr(void *data)
 					et = AHCI_ERR_NCQ;
 					ncq_err = 1;
 				}
-			} else if (istatus & AHCI_P_IX_IF) {
-				/* SATA error */
-				et = AHCI_ERR_SATA;
 			} else
 				et = AHCI_ERR_INVALID;
 			ahci_end_transaction(&ch->slot[i], et);
@@ -1121,8 +1127,6 @@ ahci_dmasetprd(void *arg, bus_dma_segmen
 
 	if (error) {
 		device_printf(slot->dev, "DMA load error\n");
-		if (!ch->readlog)
-			xpt_freeze_simq(ch->sim, 1);
 		ahci_end_transaction(slot, AHCI_ERR_INVALID);
 		return;
 	}
@@ -1161,8 +1165,6 @@ ahci_execute_transaction(struct ahci_slo
 	/* Setup the FIS for this request */
 	if (!(fis_size = ahci_setup_fis(ctp, ccb, slot->slot))) {
 		device_printf(ch->dev, "Setting up SATA FIS failed\n");
-		if (!ch->readlog)
-			xpt_freeze_simq(ch->sim, 1);
 		ahci_end_transaction(slot, AHCI_ERR_INVALID);
 		return;
 	}
@@ -1229,13 +1231,12 @@ ahci_execute_transaction(struct ahci_slo
 			/* Kick controller into sane state */
 			ahci_stop(ch->dev);
 			ahci_start(ch->dev);
-			xpt_freeze_simq(ch->sim, 1);
 		}
 		ahci_end_transaction(slot, et);
 		return;
 	}
 	/* Start command execution timeout */
-	callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 1000,
+	callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 2000,
 	    (timeout_t*)ahci_timeout, slot);
 	return;
 }
@@ -1246,24 +1247,47 @@ ahci_timeout(struct ahci_slot *slot)
 {
 	device_t dev = slot->dev;
 	struct ahci_channel *ch = device_get_softc(dev);
+	uint32_t sstatus;
+	int ccs;
 	int i;
 
 	/* Check for stale timeout. */
-	if (slot->state != AHCI_SLOT_RUNNING)
+	if (slot->state < AHCI_SLOT_RUNNING)
 		return;
 
+	/* Check if slot was not being executed last time we checked. */
+	if (slot->state < AHCI_SLOT_EXECUTING) {
+		/* Check if slot started executing. */
+		sstatus = ATA_INL(ch->r_mem, AHCI_P_SACT);
+		ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK)
+		    >> AHCI_P_CMD_CCS_SHIFT;
+		if ((sstatus & (1 << slot->slot)) != 0 || ccs == slot->slot)
+			slot->state = AHCI_SLOT_EXECUTING;
+
+		callout_reset(&slot->timeout,
+		    (int)slot->ccb->ccb_h.timeout * hz / 2000,
+		    (timeout_t*)ahci_timeout, slot);
+		return;
+	}
+
 	device_printf(dev, "Timeout on slot %d\n", slot->slot);
+	device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n",
+	    ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI),
+	    ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots,
+	    ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR));
 	/* Kick controller into sane state. */
 	ahci_stop(ch->dev);
 	ahci_start(ch->dev);
 
-	if (!ch->readlog)
-		xpt_freeze_simq(ch->sim, ch->numrslots);
 	/* Handle frozen command. */
 	if (ch->frozen) {
 		union ccb *fccb = ch->frozen;
 		ch->frozen = NULL;
 		fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+		if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) {
+			xpt_freeze_devq(fccb->ccb_h.path, 1);
+			fccb->ccb_h.status |= CAM_DEV_QFRZN;
+		}
 		xpt_done(fccb);
 	}
 	/* Handle command with timeout. */
@@ -1321,10 +1345,14 @@ ahci_end_transaction(struct ahci_slot *s
 		    BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
 		bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map);
 	}
+	/* In case of error, freeze device for proper recovery. */
+	if ((et != AHCI_ERR_NONE) && (!ch->readlog) &&
+	    !(ccb->ccb_h.status & CAM_DEV_QFRZN)) {
+		xpt_freeze_devq(ccb->ccb_h.path, 1);
+		ccb->ccb_h.status |= CAM_DEV_QFRZN;
+	}
 	/* Set proper result status. */
 	ccb->ccb_h.status &= ~CAM_STATUS_MASK;
-	if (et != AHCI_ERR_NONE)
-		ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
 	switch (et) {
 	case AHCI_ERR_NONE:
 		ccb->ccb_h.status |= CAM_REQ_CMP;
@@ -1338,6 +1366,7 @@ ahci_end_transaction(struct ahci_slot *s
 		ccb->ccb_h.status |= CAM_REQUEUE_REQ;
 		break;
 	case AHCI_ERR_TFE:
+	case AHCI_ERR_NCQ:
 		if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
 			ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
 			ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
@@ -1346,13 +1375,21 @@ ahci_end_transaction(struct ahci_slot *s
 		}
 		break;
 	case AHCI_ERR_SATA:
-			ccb->ccb_h.status |= CAM_UNCOR_PARITY;
+		if (!ch->readlog) {
+			xpt_freeze_simq(ch->sim, 1);
+			ccb->ccb_h.status &= ~CAM_STATUS_MASK;
+			ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
+		}
+		ccb->ccb_h.status |= CAM_UNCOR_PARITY;
 		break;
 	case AHCI_ERR_TIMEOUT:
+		if (!ch->readlog) {
+			xpt_freeze_simq(ch->sim, 1);
+			ccb->ccb_h.status &= ~CAM_STATUS_MASK;
+			ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
+		}
 		ccb->ccb_h.status |= CAM_CMD_TIMEOUT;
 		break;
-	case AHCI_ERR_NCQ:
-		ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR;
 	default:
 		ccb->ccb_h.status |= CAM_REQ_CMP_ERR;
 	}
@@ -1436,7 +1473,8 @@ ahci_issue_read_log(device_t dev)
 	ataio->cmd.lba_low = 0x10;
 	ataio->cmd.lba_mid = 0;
 	ataio->cmd.lba_mid_exp = 0;
-	
+	/* Freeze SIM while doing READ LOG EXT. */
+	xpt_freeze_simq(ch->sim, 1);
 	ahci_begin_transaction(dev, ccb);
 }
 
@@ -1491,6 +1529,7 @@ ahci_process_read_log(device_t dev, unio
 	}
 	free(ccb->ataio.data_ptr, M_AHCI);
 	xpt_free_ccb(ccb);
+	xpt_release_simq(ch->sim, TRUE);
 }
 
 static void
@@ -1615,12 +1654,15 @@ ahci_reset(device_t dev)
 
 	if (bootverbose)
 		device_printf(dev, "AHCI reset...\n");
-	xpt_freeze_simq(ch->sim, ch->numrslots);
 	/* Requeue freezed command. */
 	if (ch->frozen) {
 		union ccb *fccb = ch->frozen;
 		ch->frozen = NULL;
 		fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+		if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) {
+			xpt_freeze_devq(fccb->ccb_h.path, 1);
+			fccb->ccb_h.status |= CAM_DEV_QFRZN;
+		}
 		xpt_done(fccb);
 	}
 	/* Kill the engine and requeue all running commands. */
@@ -1632,6 +1674,8 @@ ahci_reset(device_t dev)
 		/* XXX; Commands in loading state. */
 		ahci_end_transaction(&ch->slot[i], AHCI_ERR_INNOCENT);
 	}
+	/* Tell the XPT about the event */
+	xpt_async(AC_BUS_RESET, ch->path, NULL);
 	/* Disable port interrupts */
 	ATA_OUTL(ch->r_mem, AHCI_P_IE, 0);
 	/* Reset and reconnect PHY, */
@@ -1661,8 +1705,6 @@ ahci_reset(device_t dev)
 	      AHCI_P_IX_DS | AHCI_P_IX_PS | (ctlr->ccc ? 0 : AHCI_P_IX_DHR)));
 	if (bootverbose)
 		device_printf(dev, "AHCI reset done: device found\n");
-	/* Tell the XPT about the event */
-	xpt_async(AC_BUS_RESET, ch->path, NULL);
 }
 
 static int

Modified: head/sys/dev/ahci/ahci.h
==============================================================================
--- head/sys/dev/ahci/ahci.h	Wed Oct 21 11:50:18 2009	(r198318)
+++ head/sys/dev/ahci/ahci.h	Wed Oct 21 12:42:25 2009	(r198319)
@@ -328,7 +328,7 @@ enum ahci_slot_states {
 	AHCI_SLOT_EMPTY,
 	AHCI_SLOT_LOADING,
 	AHCI_SLOT_RUNNING,
-	AHCI_SLOT_WAITING
+	AHCI_SLOT_EXECUTING
 };
 
 struct ahci_slot {

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 12:47:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D0869106568D;
	Wed, 21 Oct 2009 12:47:09 +0000 (UTC)
	(envelope-from stas@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE60D8FC1B;
	Wed, 21 Oct 2009 12:47:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LCl9s0099431;
	Wed, 21 Oct 2009 12:47:09 GMT (envelope-from stas@svn.freebsd.org)
Received: (from stas@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LCl9Ab099426;
	Wed, 21 Oct 2009 12:47:09 GMT (envelope-from stas@svn.freebsd.org)
Message-Id: <200910211247.n9LCl9Ab099426@svn.freebsd.org>
From: Stanislav Sedov 
Date: Wed, 21 Oct 2009 12:47:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198320 - in head/sys: conf dev/bce
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 12:47:09 -0000

Author: stas
Date: Wed Oct 21 12:47:09 2009
New Revision: 198320
URL: http://svn.freebsd.org/changeset/base/198320

Log:
  - Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header
    splitting in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not
    propagated into if_bce.c anyway.  It is disabled by default.
  
  Approved by:	davidch
  MFC after:	3 days

Modified:
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/dev/bce/if_bce.c
  head/sys/dev/bce/if_bcereg.h

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Wed Oct 21 12:42:25 2009	(r198319)
+++ head/sys/conf/NOTES	Wed Oct 21 12:47:09 2009	(r198320)
@@ -1985,6 +1985,12 @@ device		lmc
 # only works for Tigon II chips, and has no effect for Tigon I chips.
 options 	TI_JUMBO_HDRSPLIT
 
+#
+# Use header splitting feature on bce(4) adapters.
+# This may help to reduce the amount of jumbo-sized memory buffers used.
+#
+options		BCE_JUMBO_HDRSPLIT
+
 # These two options allow manipulating the mbuf cluster size and mbuf size,
 # respectively.  Be very careful with NIC driver modules when changing
 # these from their default values, because that can potentially cause a

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Wed Oct 21 12:42:25 2009	(r198319)
+++ head/sys/conf/options	Wed Oct 21 12:47:09 2009	(r198320)
@@ -511,6 +511,7 @@ DRM_DEBUG		opt_drm.h
 ZERO_COPY_SOCKETS	opt_zero.h
 TI_PRIVATE_JUMBOS	opt_ti.h
 TI_JUMBO_HDRSPLIT	opt_ti.h
+BCE_JUMBO_HDRSPLIT	opt_bce.h
 
 # XXX Conflict: # of devices vs network protocol (Native ATM).
 # This makes "atm.h" unusable.

Modified: head/sys/dev/bce/if_bce.c
==============================================================================
--- head/sys/dev/bce/if_bce.c	Wed Oct 21 12:42:25 2009	(r198319)
+++ head/sys/dev/bce/if_bce.c	Wed Oct 21 12:47:09 2009	(r198320)
@@ -293,12 +293,12 @@ static void bce_dump_enet           (str
 static void bce_dump_mbuf 			(struct bce_softc *, struct mbuf *);
 static void bce_dump_tx_mbuf_chain	(struct bce_softc *, u16, int);
 static void bce_dump_rx_mbuf_chain	(struct bce_softc *, u16, int);
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 static void bce_dump_pg_mbuf_chain	(struct bce_softc *, u16, int);
 #endif
 static void bce_dump_txbd			(struct bce_softc *, int, struct tx_bd *);
 static void bce_dump_rxbd			(struct bce_softc *, int, struct rx_bd *);
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 static void bce_dump_pgbd			(struct bce_softc *, int, struct rx_bd *);
 #endif
 static void bce_dump_l2fhdr			(struct bce_softc *, int, struct l2_fhdr *);
@@ -306,7 +306,7 @@ static void bce_dump_ctx			(struct bce_s
 static void bce_dump_ftqs			(struct bce_softc *);
 static void bce_dump_tx_chain		(struct bce_softc *, u16, int);
 static void bce_dump_rx_chain		(struct bce_softc *, u16, int);
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 static void bce_dump_pg_chain		(struct bce_softc *, u16, int);
 #endif
 static void bce_dump_status_block	(struct bce_softc *);
@@ -393,7 +393,7 @@ static int  bce_init_rx_chain		(struct b
 static void bce_fill_rx_chain		(struct bce_softc *);
 static void bce_free_rx_chain		(struct bce_softc *);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 static int  bce_get_pg_buf			(struct bce_softc *, struct mbuf *, u16 *, u16 *);
 static int  bce_init_pg_chain		(struct bce_softc *);
 static void bce_fill_pg_chain		(struct bce_softc *);
@@ -602,7 +602,7 @@ bce_print_adapter_info(struct bce_softc 
 	/* Firmware version and device features. */
 	printf("B/C (%s); Flags (", sc->bce_bc_ver);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	printf("SPLT ");
     i++;
 #endif
@@ -1066,7 +1066,7 @@ bce_attach(device_t dev)
 	 * This may change later if the MTU size is set to
 	 * something other than 1500.
 	 */
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	sc->rx_bd_mbuf_alloc_size = MHLEN;
 	/* Make sure offset is 16 byte aligned for hardware. */
 	sc->rx_bd_mbuf_align_pad  = roundup2((MSIZE - MHLEN), 16) -
@@ -2835,7 +2835,7 @@ bce_dma_free(struct bce_softc *sc)
 	}
 
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	/* Free, unmap and destroy all page buffer descriptor chain pages. */
 	for (i = 0; i < PG_PAGES; i++ ) {
 		if (sc->pg_bd_chain[i] != NULL) {
@@ -2899,7 +2899,7 @@ bce_dma_free(struct bce_softc *sc)
 		sc->rx_mbuf_tag = NULL;
 	}
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	/* Unload and destroy the page mbuf maps. */
 	for (i = 0; i < TOTAL_PG_BD; i++) {
 		if (sc->pg_mbuf_map[i] != NULL) {
@@ -3345,7 +3345,7 @@ bce_dma_alloc(device_t dev)
 	/*
 	 * Create a DMA tag for RX mbufs.
 	 */
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ?
 		MCLBYTES : sc->rx_bd_mbuf_alloc_size);
 #else
@@ -3386,7 +3386,7 @@ bce_dma_alloc(device_t dev)
 		}
 	}
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	/*
 	 * Create a DMA tag for the page buffer descriptor chain,
 	 * allocate and clear the memory, and fetch the physical
@@ -4473,7 +4473,7 @@ bce_stop(struct bce_softc *sc)
 	bce_disable_intr(sc);
 
 	/* Free RX buffers. */
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	bce_free_pg_chain(sc);
 #endif
 	bce_free_rx_chain(sc);
@@ -4910,7 +4910,7 @@ bce_get_rx_buf(struct bce_softc *sc, str
 			goto bce_get_rx_buf_exit);
 
 		/* This is a new mbuf allocation. */
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
 #else
 		if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES)
@@ -4991,7 +4991,7 @@ bce_get_rx_buf_exit:
 }
 
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 /****************************************************************************/
 /* Encapsulate an mbuf cluster into the page chain.                        */
 /*                                                                          */
@@ -5100,7 +5100,7 @@ bce_get_pg_buf_exit:
 
 	return(rc);
 }
-#endif /* ZERO_COPY_SOCKETS */
+#endif /* BCE_JUMBO_HDRSPLIT */
 
 /****************************************************************************/
 /* Initialize the TX context memory.                                        */
@@ -5456,7 +5456,7 @@ bce_free_rx_chain(struct bce_softc *sc)
 }
 
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 /****************************************************************************/
 /* Allocate memory and initialize the page data structures.                 */
 /* Assumes that bce_init_rx_chain() has not already been called.            */
@@ -5620,7 +5620,7 @@ bce_free_pg_chain(struct bce_softc *sc)
 
 	DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_RECV | BCE_VERBOSE_UNLOAD);
 }
-#endif /* ZERO_COPY_SOCKETS */
+#endif /* BCE_JUMBO_HDRSPLIT */
 
 
 /****************************************************************************/
@@ -5793,7 +5793,7 @@ bce_rx_intr(struct bce_softc *sc)
 	unsigned int pkt_len;
 	u16 sw_rx_cons, sw_rx_cons_idx, hw_rx_cons;
 	u32 status;
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	unsigned int rem_len;
 	u16 sw_pg_cons, sw_pg_cons_idx;
 #endif
@@ -5809,7 +5809,7 @@ bce_rx_intr(struct bce_softc *sc)
 		bus_dmamap_sync(sc->rx_bd_chain_tag,
 		    sc->rx_bd_chain_map[i], BUS_DMASYNC_POSTREAD);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	/* Prepare the page chain pages to be accessed by the host CPU. */
 	for (int i = 0; i < PG_PAGES; i++)
 		bus_dmamap_sync(sc->pg_bd_chain_tag,
@@ -5821,7 +5821,7 @@ bce_rx_intr(struct bce_softc *sc)
 
 	/* Get working copies of the driver's view of the consumer indices. */
 	sw_rx_cons = sc->rx_cons;
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	sw_pg_cons = sc->pg_cons;
 #endif
 
@@ -5882,7 +5882,7 @@ bce_rx_intr(struct bce_softc *sc)
 		 */
 		m_adj(m0, sizeof(struct l2_fhdr) + ETHER_ALIGN);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 		/*
 		 * Check whether the received frame fits in a single
 		 * mbuf or not (i.e. packet data + FCS <=
@@ -6056,7 +6056,7 @@ bce_rx_int_next_rx:
 		if (m0) {
 			/* Make sure we don't lose our place when we release the lock. */
 			sc->rx_cons = sw_rx_cons;
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 			sc->pg_cons = sw_pg_cons;
 #endif
 
@@ -6066,7 +6066,7 @@ bce_rx_int_next_rx:
 
 			/* Recover our place. */
 			sw_rx_cons = sc->rx_cons;
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 			sw_pg_cons = sc->pg_cons;
 #endif
 		}
@@ -6077,7 +6077,7 @@ bce_rx_int_next_rx:
 	}
 
 	/* No new packets to process.  Refill the RX and page chains and exit. */
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	sc->pg_cons = sw_pg_cons;
 	bce_fill_pg_chain(sc);
 #endif
@@ -6090,7 +6090,7 @@ bce_rx_int_next_rx:
 		bus_dmamap_sync(sc->rx_bd_chain_tag,
 		    sc->rx_bd_chain_map[i], BUS_DMASYNC_PREWRITE);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	for (int i = 0; i < PG_PAGES; i++)
 		bus_dmamap_sync(sc->pg_bd_chain_tag,
 		    sc->pg_bd_chain_map[i], BUS_DMASYNC_PREWRITE);
@@ -6336,7 +6336,7 @@ bce_init_locked(struct bce_softc *sc)
 	 * Calculate and program the hardware Ethernet MTU
 	 * size. Be generous on the receive if we have room.
 	 */
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	if (ifp->if_mtu <= (sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size))
 		ether_mtu = sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size;
 #else
@@ -6368,7 +6368,7 @@ bce_init_locked(struct bce_softc *sc)
 	/* Program appropriate promiscuous/multicast filtering. */
 	bce_set_rx_mode(sc);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_mbuf_alloc_size = %d\n",
 		__FUNCTION__, sc->pg_bd_mbuf_alloc_size);
 
@@ -6881,7 +6881,7 @@ bce_ioctl(struct ifnet *ifp, u_long comm
 			BCE_LOCK(sc);
 			ifp->if_mtu = ifr->ifr_mtu;
 			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 			/* No buffer allocation size changes are necessary. */
 #else
 			/* Recalculate our buffer allocation sizes. */
@@ -7584,7 +7584,7 @@ bce_tick(void *xsc)
 	bce_stats_update(sc);
 
 	/* Top off the receive and page chains. */
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	bce_fill_pg_chain(sc);
 #endif
 	bce_fill_rx_chain(sc);
@@ -7764,7 +7764,7 @@ bce_sysctl_dump_tx_chain(SYSCTL_HANDLER_
 }
 
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 /****************************************************************************/
 /* Provides a sysctl interface to allow dumping the page chain.             */
 /*                                                                          */
@@ -8392,7 +8392,7 @@ bce_add_sysctls(struct bce_softc *sc)
 		(void *)sc, 0,
 		bce_sysctl_dump_tx_chain, "I", "Dump tx_bd chain");
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	SYSCTL_ADD_PROC(ctx, children, OID_AUTO,
 		"dump_pg_chain", CTLTYPE_INT | CTLFLAG_RW,
 		(void *)sc, 0,
@@ -8687,7 +8687,7 @@ bce_dump_rx_mbuf_chain(struct bce_softc 
 }
 
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 /****************************************************************************/
 /* Prints out the mbufs in the mbuf page chain.                             */
 /*                                                                          */
@@ -8811,7 +8811,7 @@ bce_dump_rxbd(struct bce_softc *sc, int 
 }
 
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 /****************************************************************************/
 /* Prints out a rx_bd structure in the page chain.                          */
 /*                                                                          */
@@ -9298,7 +9298,7 @@ bce_dump_rx_chain(struct bce_softc *sc, 
 }
 
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 /****************************************************************************/
 /* Prints out the page chain.                                               */
 /*                                                                          */
@@ -9779,7 +9779,7 @@ bce_dump_driver_state(struct bce_softc *
 		"0x%08X:%08X - (sc->rx_bd_chain) rx_bd chain virtual address\n",
 		val_hi, val_lo);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	val_hi = BCE_ADDR_HI(sc->pg_bd_chain);
 	val_lo = BCE_ADDR_LO(sc->pg_bd_chain);
 	BCE_PRINTF(
@@ -9799,7 +9799,7 @@ bce_dump_driver_state(struct bce_softc *
 		"0x%08X:%08X - (sc->rx_mbuf_ptr) rx mbuf chain virtual address\n",
 		val_hi, val_lo);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	val_hi = BCE_ADDR_HI(sc->pg_mbuf_ptr);
 	val_lo = BCE_ADDR_LO(sc->pg_mbuf_ptr);
 	BCE_PRINTF(
@@ -9852,7 +9852,7 @@ bce_dump_driver_state(struct bce_softc *
 	BCE_PRINTF("         0x%08X - (sc->free_rx_bd) free rx_bd's\n",
 		sc->free_rx_bd);
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	BCE_PRINTF("     0x%04X(0x%04X) - (sc->pg_prod) page producer index\n",
 		sc->pg_prod, (u16) PG_CHAIN_IDX(sc->pg_prod));
 
@@ -10358,7 +10358,7 @@ bce_breakpoint(struct bce_softc *sc)
 		bce_dump_tpat_state(sc, 0);
 		bce_dump_cp_state(sc, 0);
 		bce_dump_com_state(sc, 0);
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 		bce_dump_pgbd(sc, 0, NULL);
 		bce_dump_pg_mbuf_chain(sc, 0, USABLE_PG_BD);
 		bce_dump_pg_chain(sc, 0, USABLE_PG_BD);

Modified: head/sys/dev/bce/if_bcereg.h
==============================================================================
--- head/sys/dev/bce/if_bcereg.h	Wed Oct 21 12:42:25 2009	(r198319)
+++ head/sys/dev/bce/if_bcereg.h	Wed Oct 21 12:47:09 2009	(r198320)
@@ -6216,7 +6216,7 @@ struct l2_fhdr {
 #define RX_PAGE(x) (((x) & ~USABLE_RX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
 #define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE)
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 /*
  * To accomodate jumbo frames, the page chain should
  * be 4 times larger than the receive chain.
@@ -6238,7 +6238,7 @@ struct l2_fhdr {
 #define PG_PAGE(x) (((x) & ~USABLE_PG_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4))
 #define PG_IDX(x) ((x) & USABLE_PG_BD_PER_PAGE)
 
-#endif /* ZERO_COPY_SOCKETS */
+#endif /* BCE_JUMBO_HDRSPLIT */
 
 #define CTX_INIT_RETRY_COUNT        10
 
@@ -6517,7 +6517,7 @@ struct bce_softc
 	u16					tx_cons;
 	u32					tx_prod_bseq;	/* Counts the bytes used.  */
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	u16					pg_prod;
 	u16					pg_cons;
 #endif
@@ -6534,7 +6534,7 @@ struct bce_softc
 	int					rx_bd_mbuf_data_len;
 	int					rx_bd_mbuf_align_pad;
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	int					pg_bd_mbuf_alloc_size;
 #endif
 
@@ -6556,7 +6556,7 @@ struct bce_softc
 	struct rx_bd		*rx_bd_chain[RX_PAGES];
 	bus_addr_t			rx_bd_chain_paddr[RX_PAGES];
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	/* H/W maintained page buffer descriptor chain structure. */
 	bus_dma_tag_t		pg_bd_chain_tag;
 	bus_dmamap_t		pg_bd_chain_map[PG_PAGES];
@@ -6593,7 +6593,7 @@ struct bce_softc
 	bus_dma_tag_t		rx_mbuf_tag;
 	bus_dma_tag_t		tx_mbuf_tag;
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	bus_dma_tag_t		pg_mbuf_tag;
 #endif
 
@@ -6605,7 +6605,7 @@ struct bce_softc
 	bus_dmamap_t		rx_mbuf_map[TOTAL_RX_BD];
 	struct mbuf			*rx_mbuf_ptr[TOTAL_RX_BD];
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	/* S/W maintained mbuf page chain structure. */
 	bus_dmamap_t		pg_mbuf_map[TOTAL_PG_BD];
 	struct mbuf			*pg_mbuf_ptr[TOTAL_PG_BD];
@@ -6617,7 +6617,7 @@ struct bce_softc
 	u16 used_tx_bd;
 	u16 max_tx_bd;
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	u16 free_pg_bd;
 	u16 max_pg_bd;
 #endif
@@ -6705,7 +6705,7 @@ struct bce_softc
 	int	debug_tx_mbuf_alloc;
 	int debug_rx_mbuf_alloc;
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	int debug_pg_mbuf_alloc;
 #endif
 
@@ -6722,7 +6722,7 @@ struct bce_softc
 	u32	rx_low_watermark;			/* Lowest number of rx_bd's free. */
 	u32 rx_empty_count;				/* Number of times the RX chain was empty. */
 
-#ifdef ZERO_COPY_SOCKETS
+#ifdef BCE_JUMBO_HDRSPLIT
 	u32	pg_low_watermark;			/* Lowest number of pages free. */
 	u32 pg_empty_count; 			/* Number of times the page chain was empty. */
 #endif

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 12:47:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 44D7C106568B;
	Wed, 21 Oct 2009 12:47:40 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 299268FC1A;
	Wed, 21 Oct 2009 12:47:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LCleMd099478;
	Wed, 21 Oct 2009 12:47:40 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LCleHj099476;
	Wed, 21 Oct 2009 12:47:40 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910211247.n9LCleHj099476@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 21 Oct 2009 12:47:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198321 - head/sys/dev/siis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 12:47:40 -0000

Author: mav
Date: Wed Oct 21 12:47:39 2009
New Revision: 198321
URL: http://svn.freebsd.org/changeset/base/198321

Log:
  MFp4:
  Freeze device queue on error to permit periph driver to do proper recovery.

Modified:
  head/sys/dev/siis/siis.c

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c	Wed Oct 21 12:47:09 2009	(r198320)
+++ head/sys/dev/siis/siis.c	Wed Oct 21 12:47:39 2009	(r198321)
@@ -752,7 +752,12 @@ siis_ch_intr(void *data)
 		if (ch->frozen) {
 			union ccb *fccb = ch->frozen;
 			ch->frozen = NULL;
-			fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+			fccb->ccb_h.status &= ~CAM_STATUS_MASK;
+			fccb->ccb_h.status |= CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+			if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) {
+				xpt_freeze_devq(fccb->ccb_h.path, 1);
+				fccb->ccb_h.status |= CAM_DEV_QFRZN;
+			}
 			xpt_done(fccb);
 		}
 		if (estatus == SIIS_P_CMDERR_DEV ||
@@ -986,7 +991,12 @@ device_printf(dev, "%s is %08x ss %08x r
 	if (ch->frozen) {
 		union ccb *fccb = ch->frozen;
 		ch->frozen = NULL;
-		fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+		fccb->ccb_h.status &= ~CAM_STATUS_MASK;
+		fccb->ccb_h.status |= CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+		if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) {
+			xpt_freeze_devq(fccb->ccb_h.path, 1);
+			fccb->ccb_h.status |= CAM_DEV_QFRZN;
+		}
 		xpt_done(fccb);
 	}
 	/* Handle command with timeout. */
@@ -1044,11 +1054,17 @@ siis_end_transaction(struct siis_slot *s
 		bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map);
 	}
 	/* Set proper result status. */
-	ccb->ccb_h.status &= ~CAM_STATUS_MASK;
 	if (et != SIIS_ERR_NONE || ch->recovery) {
 		ch->eslots |= (1 << slot->slot);
 		ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
 	}
+	/* In case of error, freeze device for proper recovery. */
+	if (et != SIIS_ERR_NONE &&
+	    !(ccb->ccb_h.status & CAM_DEV_QFRZN)) {
+		xpt_freeze_devq(ccb->ccb_h.path, 1);
+		ccb->ccb_h.status |= CAM_DEV_QFRZN;
+	}
+	ccb->ccb_h.status &= ~CAM_STATUS_MASK;
 	switch (et) {
 	case SIIS_ERR_NONE:
 		ccb->ccb_h.status |= CAM_REQ_CMP;
@@ -1062,6 +1078,7 @@ siis_end_transaction(struct siis_slot *s
 		ccb->ccb_h.status |= CAM_REQUEUE_REQ;
 		break;
 	case SIIS_ERR_TFE:
+	case SIIS_ERR_NCQ:
 		if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
 			ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
 			ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
@@ -1075,9 +1092,6 @@ siis_end_transaction(struct siis_slot *s
 	case SIIS_ERR_TIMEOUT:
 		ccb->ccb_h.status |= CAM_CMD_TIMEOUT;
 		break;
-	case SIIS_ERR_NCQ:
-		ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR;
-		break;
 	default:
 		ccb->ccb_h.status |= CAM_REQ_CMP_ERR;
 	}
@@ -1281,7 +1295,12 @@ siis_reset(device_t dev)
 	if (ch->frozen) {
 		union ccb *fccb = ch->frozen;
 		ch->frozen = NULL;
-		fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+		fccb->ccb_h.status &= ~CAM_STATUS_MASK;
+		fccb->ccb_h.status |= CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ;
+		if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) {
+			xpt_freeze_devq(fccb->ccb_h.path, 1);
+			fccb->ccb_h.status |= CAM_DEV_QFRZN;
+		}
 		xpt_done(fccb);
 	}
 	/* Disable port interrupts */

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 13:00:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 69C85106568B;
	Wed, 21 Oct 2009 13:00:02 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 387BB8FC15;
	Wed, 21 Oct 2009 13:00:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LD0235099734;
	Wed, 21 Oct 2009 13:00:02 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LD02V3099731;
	Wed, 21 Oct 2009 13:00:02 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910211300.n9LD02V3099731@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 21 Oct 2009 13:00:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198322 - in head/sys: cam/ata dev/ahci dev/siis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 13:00:02 -0000

Author: mav
Date: Wed Oct 21 13:00:01 2009
New Revision: 198322
URL: http://svn.freebsd.org/changeset/base/198322

Log:
  MFp4:
  Report real max_target = 15. SIM doesn't need to know that target 15 is PMP.
  It is XPT business.

Modified:
  head/sys/cam/ata/ata_xpt.c
  head/sys/dev/ahci/ahci.c
  head/sys/dev/siis/siis.c

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Wed Oct 21 12:47:39 2009	(r198321)
+++ head/sys/cam/ata/ata_xpt.c	Wed Oct 21 13:00:01 2009	(r198322)
@@ -1212,7 +1212,8 @@ ata_scan_bus(struct cam_periph *periph, 
 take_next:
 		/* Take next device. Wrap from 15 (PM) to 0. */
 		scan_info->counter = (scan_info->counter + 1 ) & 0x0f;
-		if (scan_info->counter >= scan_info->cpi->max_target+1) {
+		if (scan_info->counter > scan_info->cpi->max_target -
+		    ((scan_info->cpi->hba_inquiry & PI_SATAPM) ? 1 : 0)) {
 			xpt_free_ccb(work_ccb);
 			xpt_free_ccb((union ccb *)scan_info->cpi);
 			request_ccb = scan_info->request_ccb;

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Wed Oct 21 12:47:39 2009	(r198321)
+++ head/sys/dev/ahci/ahci.c	Wed Oct 21 13:00:01 2009	(r198322)
@@ -1967,7 +1967,7 @@ ahciaction(struct cam_sim *sim, union cc
 		cpi->hba_misc = PIM_SEQSCAN;
 		cpi->hba_eng_cnt = 0;
 		if (ch->caps & AHCI_CAP_SPM)
-			cpi->max_target = 14;
+			cpi->max_target = 15;
 		else
 			cpi->max_target = 0;
 		cpi->max_lun = 0;

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c	Wed Oct 21 12:47:39 2009	(r198321)
+++ head/sys/dev/siis/siis.c	Wed Oct 21 13:00:01 2009	(r198322)
@@ -1584,7 +1584,7 @@ siisaction(struct cam_sim *sim, union cc
 		cpi->target_sprt = 0;
 		cpi->hba_misc = PIM_SEQSCAN;
 		cpi->hba_eng_cnt = 0;
-		cpi->max_target = 14;
+		cpi->max_target = 15;
 		cpi->max_lun = 0;
 		cpi->initiator_id = 0;
 		cpi->bus_id = cam_sim_bus(sim);

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 13:25:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A9C4106566B;
	Wed, 21 Oct 2009 13:25:25 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 550ED8FC1E;
	Wed, 21 Oct 2009 13:25:25 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id DC73B46B0C;
	Wed, 21 Oct 2009 09:25:24 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 1229C8A025;
	Wed, 21 Oct 2009 09:25:24 -0400 (EDT)
From: John Baldwin 
To: Rink Springer 
Date: Wed, 21 Oct 2009 09:13:11 -0400
User-Agent: KMail/1.9.7
References: <200910211110.n9LBAYG6097426@svn.freebsd.org>
In-Reply-To: <200910211110.n9LBAYG6097426@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200910210913.12038.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Wed, 21 Oct 2009 09:25:24 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198317 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 13:25:25 -0000

On Wednesday 21 October 2009 7:10:34 am Rink Springer wrote:
> Author: rink
> Date: Wed Oct 21 11:10:34 2009
> New Revision: 198317
> URL: http://svn.freebsd.org/changeset/base/198317
> 
> Log:
>   Introduce 'netDev=ANY' support for scripted (install.cfg) installs, which 
results in the first ethernet interface with physical link being selected.
>   
>   While here, fix a minor typo causing an 'if' to be missed.
>   
>   Submitted by:	randi

Note that in the case of PXE you can use a shell script to automatically use 
the PXE interface.  I do this in my scripts here at work.  install.cfg 
contains:

# Figure out our installation media and configure it.
command=/bin/sh /stand/domedia.sh
system
configFile=/stand/media.cfg
loadConfig

And domedia.sh contains this code to figure out which network interface to use 
if a kernel environment variable is set to indicate an NFS install (vs a CD 
install, the scripts support both) (Note that I have added kenv and dialog to 
my mfsroot):

#!/bin/sh
#
# Figure out which install media we want to use.

netif=`kenv -q install.netif`
nfspath=`kenv -q install.nfspath`

# Determine if a given network interface has link
# XXX: some drivers only report link if the interface is UP
netif_up()
{
	local status

	status=`ifconfig $1 | sed -ne '/status:/p'`
	case $status in
		*active*)
			return 0
			;;
	esac
	return 1
}

# Returns true if a given network interface has the specified MAC address.
macmatch()
{
	local addr

	addr=`ifconfig $1 | sed -ne '/	ether /{s///;p;}'`
	[ "$addr" = "$2" ]
	return $?
}

# If 'nfspath' is set, assume we are using NFS, otherwise, assume we
# are installing from a CD.
if [ -n "${nfspath}" ]; then
	# If netif isn't set, try to guess at a sane value.
	if [ -z "${netif}" ]; then
		# This is set by the loader when booting via PXE
		macaddr=`kenv -q boot.netif.hwaddr`
		macif=""
		count=0
		upcount=0
		ifaces=""
		upifaces=""
		for ifn in `ifconfig -l`; do
			case $ifn in
				lo0)
					# Ignore loopback
					;;
				*)
					count=$((count + 1))
					ifaces="${ifaces} ${ifn}"
					if netif_up $ifn; then
						upcount=$((upcount + 1))
						upifaces="${upifaces} ${ifn}"
					fi
					if [ -n "$macaddr" ] && \
					    macmatch $ifn $macaddr; then
						macif="$ifn"
					fi
					;;
			esac
		done

		# If there is only a single interface, use that.  If
		# we booted via PXE and the MAC address for PXE
		# matches the MAC address of an interface, use that.
		# Finally, if only one interface has link, use that.
		# If all of those tests fail, pop up a menu.
		if [ $count -eq 1 ]; then
			# The echo trims extra spaces
			netif=`echo $ifaces`
		elif [ -n "$macif" ]; then
			netif="$macif"
		elif [ $upcount -eq 1 ]; then
			# The echo trims extra spaces
			netif=`echo $upifaces`
		else
			# Build the menu
			ifmenu=""
			for ifn in $ifaces; do
				ifmenu="${ifmenu} ${ifn} Network"
			done

			# Run the menu
			while [ -z "${netif}" ]; do
				rm -f /stand/netif
				dialog --menu "Select the network interface to use for NFS." \
				    $((count + 7)) 50 $((count)) ${ifmenu} 2> \
				    /stand/netif
				if [ $? -eq 0 ]; then
					netif=`cat /stand/netif`
				fi
			done
		fi
	fi

	cat > /stand/media.cfg < /stand/media.cfg <
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C4919106566B;
	Wed, 21 Oct 2009 13:32:07 +0000 (UTC)
	(envelope-from remko@elvandar.org)
Received: from mailgate.jr-hosting.nl (mailgate.jr-hosting.nl [78.46.126.30])
	by mx1.freebsd.org (Postfix) with ESMTP id 7CC328FC08;
	Wed, 21 Oct 2009 13:32:07 +0000 (UTC)
Received: from websrv01.jr-hosting.nl (websrv01 [78.47.69.233])
	by mailgate.jr-hosting.nl (Postfix) with ESMTP id C5CA81CD26;
	Wed, 21 Oct 2009 15:32:05 +0200 (CEST)
Received: from dolgan.elvandar.org ([78.47.44.218] helo=[10.0.3.2])
	by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1N0bIL-000Dnu-Nj; Wed, 21 Oct 2009 15:32:05 +0200
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
From: Remko Lodder 
In-Reply-To: <20091021222805.I12783@delplex.bde.org>
Date: Wed, 21 Oct 2009 15:32:04 +0200
Content-Transfer-Encoding: 7bit
Message-Id: <7E425E81-2ACC-46F8-B864-169CDBFBB03B@elvandar.org>
References: <200910211015.n9LAFQwY094532@svn.freebsd.org>
	<20091021222805.I12783@delplex.bde.org>
To: Bruce Evans 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, Remko Lodder ,
	src-committers@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 13:32:07 -0000


Hey Bruce,

On Oct 21, 2009, at 2:19 PM, Bruce Evans wrote:

> On Wed, 21 Oct 2009, Remko Lodder wrote:
>
>> Log:
>> The tunefs utility does not work on active filesystems.
>
> Er, that's what it already said.  Now it says less.  Except, it is
> implicit in the statement being in the BUGS section that it is a bug
> for tunefs to not work on active file systems, just like it used to
> be implicit that tunefs did not work on active file systems.


[snip valuable info]

I'll try to implement your suggestions in a patch. Hopefully I'll have  
that available later today. Can I send it over to you for reviewal so  
that
we are sure to have the correct fix ?

Thanks a lot for the feedback!

Cheers,
Remko

-- 
/"\   Best regards,                        | remko@FreeBSD.org
\ /   Remko Lodder                      | remko@EFnet
X    http://www.evilcoder.org/    |
/ \   ASCII Ribbon Campaign    | Against HTML Mail and News


From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 13:50:19 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35E171065670;
	Wed, 21 Oct 2009 13:50:19 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au
	[211.29.132.185])
	by mx1.freebsd.org (Postfix) with ESMTP id BD1868FC12;
	Wed, 21 Oct 2009 13:50:18 +0000 (UTC)
Received: from c122-106-156-249.carlnfd1.nsw.optusnet.com.au
	(c122-106-156-249.carlnfd1.nsw.optusnet.com.au [122.106.156.249])
	by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n9LDoEtD026799
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 22 Oct 2009 00:50:16 +1100
Date: Thu, 22 Oct 2009 00:50:14 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Andriy Gapon 
In-Reply-To: <4ADEF6C8.3060808@freebsd.org>
Message-ID: <20091021233345.N12823@delplex.bde.org>
References: <200910211015.n9LAFQwY094532@svn.freebsd.org>
	<9bbcef730910210428i4b39b358sbcfb76d882a4c24a@mail.gmail.com>
	<4ADEF6C8.3060808@freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, Remko Lodder ,
	src-committers@FreeBSD.org, Ivan Voras ,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 13:50:19 -0000

On Wed, 21 Oct 2009, Andriy Gapon wrote:

> on 21/10/2009 14:28 Ivan Voras said the following:
>> 2009/10/21 Remko Lodder :
>>> Log:
>>>  The tunefs utility does not work on active filesystems.
>>
>>>  .Sh BUGS
>>> -This utility should work on active file systems.
>>> +This utility does not work on active file systems.
>>>  To change the root file system, the system must be rebooted
>>>  after the file system is tuned.
>>
>> Hmm, if it doesn't work on active file system, there is no way to
>> change the root file system :)

It's certainly supposed to work for the root file system.  In 4.4BSD,
this working was fragile, as partly explained above.  -- Hmm, this
commit was more broken that I first noticed (see other mail).  It makes
the second sentence in the above paragraph more inconsistent with the
first sentence than before.  The first sentence says that tunefs DOES
NOT work.  The second sentence still says that tuning using tunefs (if
not tunefs itself) does work after the system is rebooted. --  The
fragile working was as follows:

(1) 4.4BSD wasn't missing block devices

(2) the only restrictions on writing to the character device corresponding
     to a mounted block device were:
     (a) at securelevel >= 1
     (b) fsck had some internal restrictions, or at least partly understood
 	the problem and tried to do the right thing for a root file system
 	mounted read-only -- this involves writing to the cdev and then
 	updating the bdev using mount(...MNT_UPDATE...).  This was supposed
 	to be only supported for the root file system, but determination of
 	the of the mounted root bdev corresponding to the cdev being fscked
 	was fragile.

(3) tunefs had no understanding of this problem.  It happlily wrote to the
     cdev (at least if you started old it operate on a cdev).  Thus, even
     if the root file system, or any file system, was mounted r/w and active,
     you could change its superblock using tunefs.  The mounted file system
     wouldn't see the changes, but might after reboot.  If the mount was r/o,
     then the changes made by tunefs were preserved on reboot and did work
     after reboot.  If the mount was r/w, then I think unmount normally
     clobbered any changes made by tunefs, but you could probably reboot
     with no sync and then have the changes work after reboot.  The second
     sentence in the above part of the man page is about doing this in the
     nice case when the root file system is mounted r/o.  It fails to
     mention the requirement that the file system is mounted r/o.  This
     seems to have been out of date even in 4.4BSD -- rebooting shouldn't
     have been necessary, since you could just force the necessary
     mount(...MNT_UPDATE...) using mount -u.  tunefs plus mount -u had a
     good chance of working safely (but with minor races) even for r/w
     mounts.

FreeBSD fixed tunefs in 1999 to do the necessary mount(...MOUNT_UPDATE...)
automatically in the r/o mount case so that the complications in (3)
and the second sentence in the above part of the man page mostly no
longer matter.  They still applied to r/w mounts.

(1a) FreeBSD broke (axed) support for block devices later in 1999 or 2000.

(2a) When block devices were broken, the hack in (2) was replaced by an
      diffently fragile hack and to support fsck.  Now there is only a
      cdev, it is easy to prevent opens for write on a mounted cdev,
      but this restriction cannot be completly enforced without breaking
      fsck on the root file system (mounted r/o), and also tunefs on
      r/o mounts.  Opens for writing were disallowed on cdevs for file
      systems mounted r/w, but allowed on cdevs for file systems mounted
      r/o.  This almost completed the bitrot in the second sentence in
      the above part of in the man page -- now the r/w mount case is
      unreachable and the r/o case doesn't need a reboot; there is no
      longer any fragility associating the device being written to by
      tunefs with a mounted device, but there is associated fragility
      invlolving writing via an cdev alias or container device -- the
      alias just needs to be another cdev instead of a bdev.

(3a) Hack (2a) kept tunefs and of course fsck working on cdevs for file
      systems mounted r/o.  Now they fail better on cdevs for file systems
      mounted r/w.

> Booting with alternative root (possibly from alternative media)?

As you know, there is further breakage in this area:

(2b) AFIAK, the hack is now only applied to the root file system and then
      only to its initial r/o mount.  Thus even fsck on a cdev for the root
      file system mounted r/o is now broken except for the initial mount.
      E.g., "kill -TERM 1" followed by umount -A (and "mount -u -o ro /")
      is no longer sufficient for fscking the root file system after entering
      multi-user mode.

(3b) I guess tunefs on cdevs mounted r/o is now broken by (2b), except for
      the initial r/o mount of the root file system.  Changes near (2b) also
      prevent writing via aliases and containers.  This more than completes
      the bitrot in the second sentence in the above part of the man page --
      the r/w case is now unreachable, and the r/o case is mostly unreachable
      too :-(.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 14:09:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DF5C91065679;
	Wed, 21 Oct 2009 14:09:06 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CDB718FC1B;
	Wed, 21 Oct 2009 14:09:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LE967j001471;
	Wed, 21 Oct 2009 14:09:06 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LE96se001469;
	Wed, 21 Oct 2009 14:09:06 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910211409.n9LE96se001469@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 21 Oct 2009 14:09:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198327 - head/sys/dev/aic7xxx/aicasm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 14:09:07 -0000

Author: brueffer
Date: Wed Oct 21 14:09:06 2009
New Revision: 198327
URL: http://svn.freebsd.org/changeset/base/198327

Log:
  Add a missing free() call.
  
  PR:		138379
  Submitted by:	Patroklos Argyroudis 
  Reviewed by:	gibbs
  MFC after:	1 week

Modified:
  head/sys/dev/aic7xxx/aicasm/aicasm.c

Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c
==============================================================================
--- head/sys/dev/aic7xxx/aicasm/aicasm.c	Wed Oct 21 14:05:51 2009	(r198326)
+++ head/sys/dev/aic7xxx/aicasm/aicasm.c	Wed Oct 21 14:09:06 2009	(r198327)
@@ -639,6 +639,8 @@ output_listing(char *ifilename)
 		}
 		instrptr++;
 	}
+	free(func_values);
+
 	/* Dump the remainder of the file */
 	while(fgets(buf, sizeof(buf), ifile) != NULL)
 		fprintf(listfile, "             %s", buf);

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 14:11:57 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 209731065672;
	Wed, 21 Oct 2009 14:11:57 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au
	[211.29.132.188])
	by mx1.freebsd.org (Postfix) with ESMTP id AD11B8FC14;
	Wed, 21 Oct 2009 14:11:56 +0000 (UTC)
Received: from c122-106-156-249.carlnfd1.nsw.optusnet.com.au
	(c122-106-156-249.carlnfd1.nsw.optusnet.com.au [122.106.156.249])
	by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n9LEBDSm003437
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 22 Oct 2009 01:11:14 +1100
Date: Thu, 22 Oct 2009 01:11:12 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Remko Lodder 
In-Reply-To: <7E425E81-2ACC-46F8-B864-169CDBFBB03B@elvandar.org>
Message-ID: <20091022005227.A12866@delplex.bde.org>
References: <200910211015.n9LAFQwY094532@svn.freebsd.org>
	<20091021222805.I12783@delplex.bde.org>
	<7E425E81-2ACC-46F8-B864-169CDBFBB03B@elvandar.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, Remko Lodder ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	Bruce Evans 
Subject: Re: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 14:11:57 -0000

On Wed, 21 Oct 2009, Remko Lodder wrote:

> I'll try to implement your suggestions in a patch. Hopefully I'll have that 
> available later today. Can I send it over to you for reviewal so that
> we are sure to have the correct fix ?

It turned out to be mostly a kernel bug (I think -- I most don't use kernels
with the bug), so fixing it is not very easy.  The man page should just
say something like "... should (but does not ) work on ".

 should be replaced by a list of what doesn't work (but should)
and  should be replaced by something like "file systems mounted
r/o" (if that is what "active" should mean now).o

NetBSD's 2005 version says:

% BUGS
%      This program should work on mounted and active file systems.  Because the
%      super-block is not kept in the buffer cache, the changes will only take
%      effect if the program is run on unmounted file systems.  To change the
%      root file system, the system must be rebooted after the file system is
%      tuned.

"mounted and active" is as unclear as "active".  The rotted words about
rebooting seem to have come from here -- I just noticed that they are
very recent additions to FreeBSD's tunefs.8.  They were added in 2007
8 years after they stopped applying.  Bah, they aren't evem wrong like
that: allthough they are identical to NetBSD, they have a completely
different meaning.  In NetBSD they are related to the buffer cache as
dsecribed above, but in FreeBSD they are a special case for soft updates,
as described only in their log message.  It takes a full mount to get the
soft updates flag looked at, so the remount done by tunefs doesn't work
for changes to the soft updates flag.

So you can't just remove the second sentence, but must reword it to say
something relevant.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 14:20:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20694106566B;
	Wed, 21 Oct 2009 14:20:56 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0DAC28FC24;
	Wed, 21 Oct 2009 14:20:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LEKtwb001777;
	Wed, 21 Oct 2009 14:20:55 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LEKttk001775;
	Wed, 21 Oct 2009 14:20:55 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910211420.n9LEKttk001775@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 21 Oct 2009 14:20:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198328 - head/sys/cam/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 14:20:56 -0000

Author: mav
Date: Wed Oct 21 14:20:55 2009
New Revision: 198328
URL: http://svn.freebsd.org/changeset/base/198328

Log:
  MFp4:
  Add support for PIO-only devices.
  Fix maxio values and 256 sectors transactions for 28bits commands.
  Implement periodic ordered commands insertion, sames as da driver does.
  Remove some SCSIsms.

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Wed Oct 21 14:09:06 2009	(r198327)
+++ head/sys/cam/ata/ata_da.c	Wed Oct 21 14:20:55 2009	(r198328)
@@ -63,37 +63,32 @@ __FBSDID("$FreeBSD$");
 #define ATA_MAX_28BIT_LBA               268435455UL
 
 typedef enum {
-	ADA_STATE_NORMAL
+	ADA_STATE_NORMAL,
+	ADA_STATE_SET_MULTI
 } ada_state;
 
 typedef enum {
 	ADA_FLAG_PACK_INVALID	= 0x001,
 	ADA_FLAG_CAN_48BIT	= 0x002,
 	ADA_FLAG_CAN_FLUSHCACHE	= 0x004,
-	ADA_FLAG_CAN_NCQ		= 0x008,
-	ADA_FLAG_TAGGED_QUEUING	= 0x010,
+	ADA_FLAG_CAN_NCQ	= 0x008,
+	ADA_FLAG_CAN_DMA	= 0x010,
 	ADA_FLAG_NEED_OTAG	= 0x020,
 	ADA_FLAG_WENT_IDLE	= 0x040,
-	ADA_FLAG_RETRY_UA	= 0x080,
 	ADA_FLAG_OPEN		= 0x100,
 	ADA_FLAG_SCTX_INIT	= 0x200
 } ada_flags;
 
 typedef enum {
-	ADA_Q_NONE		= 0x00,
-	ADA_Q_NO_SYNC_CACHE	= 0x01,
-	ADA_Q_NO_6_BYTE		= 0x02,
-	ADA_Q_NO_PREVENT		= 0x04
+	ADA_Q_NONE		= 0x00
 } ada_quirks;
 
 typedef enum {
-	ADA_CCB_PROBE		= 0x01,
-	ADA_CCB_PROBE2		= 0x02,
+	ADA_CCB_SET_MULTI	= 0x01,
 	ADA_CCB_BUFFER_IO	= 0x03,
 	ADA_CCB_WAITING		= 0x04,
 	ADA_CCB_DUMP		= 0x05,
 	ADA_CCB_TYPE_MASK	= 0x0F,
-	ADA_CCB_RETRY_UA		= 0x10
 } ada_ccb_state;
 
 /* Offsets into our private area for storing information */
@@ -117,6 +112,7 @@ struct ada_softc {
 	ada_quirks quirks;
 	int	 ordered_tag_count;
 	int	 outstanding_cmds;
+	int	 secsperint;
 	struct	 disk_params params;
 	struct	 disk *disk;
 	union	 ccb saved_ccb;
@@ -289,8 +285,7 @@ adaclose(struct disk *dp)
 		else
 			ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0);
 		cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0,
-		    /*sense_flags*/SF_RETRY_UA,
-		    softc->disk->d_devstat);
+		    /*sense_flags*/0, softc->disk->d_devstat);
 
 		if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
 			xpt_print(periph->path, "Synchronize cache failed\n");
@@ -331,19 +326,6 @@ adastrategy(struct bio *bp)
 
 	cam_periph_lock(periph);
 
-#if 0
-	/*
-	 * check it's not too big a transfer for our adapter
-	 */
-	scsi_minphys(bp,&sd_switch);
-#endif
-
-	/*
-	 * Mask interrupts so that the pack cannot be invalidated until
-	 * after we are in the queue.  Otherwise, we might not properly
-	 * clean up one of the buffers.
-	 */
-	
 	/*
 	 * If the device has been made invalid, error out
 	 */
@@ -551,11 +533,6 @@ adaasync(void *callback_arg, u_int32_t c
 		if (cgd->protocol != PROTO_ATA)
 			break;
 
-//		if (SID_TYPE(&cgd->inq_data) != T_DIRECT
-//		    && SID_TYPE(&cgd->inq_data) != T_RBC
-//		    && SID_TYPE(&cgd->inq_data) != T_OPTICAL)
-//			break;
-
 		/*
 		 * Allocate a peripheral instance for
 		 * this device and start the probe
@@ -576,18 +553,18 @@ adaasync(void *callback_arg, u_int32_t c
 	case AC_SENT_BDR:
 	case AC_BUS_RESET:
 	{
-		struct ada_softc *softc;
-		struct ccb_hdr *ccbh;
+		struct ada_softc *softc = (struct ada_softc *)periph->softc;
 
-		softc = (struct ada_softc *)periph->softc;
+		cam_periph_async(periph, code, path, arg);
+		if (softc->state != ADA_STATE_NORMAL)
+			break;
 		/*
-		 * Don't fail on the expected unit attention
-		 * that will occur.
+		 * Restore device configuration.
 		 */
-		softc->flags |= ADA_FLAG_RETRY_UA;
-		LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le)
-			ccbh->ccb_state |= ADA_CCB_RETRY_UA;
-		/* FALLTHROUGH*/
+		softc->state = ADA_STATE_SET_MULTI;
+		cam_periph_acquire(periph);
+		xpt_schedule(periph, 0);
+		break;
 	}
 	default:
 		cam_periph_async(periph, code, path, arg);
@@ -651,14 +628,15 @@ adaregister(struct cam_periph *periph, v
 
 	if (softc == NULL) {
 		printf("adaregister: Unable to probe new device. "
-		       "Unable to allocate softc\n");				
+		    "Unable to allocate softc\n");
 		return(CAM_REQ_CMP_ERR);
 	}
 
 	LIST_INIT(&softc->pending_ccbs);
-	softc->state = ADA_STATE_NORMAL;
 	bioq_init(&softc->bio_queue);
 
+	if (cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA)
+		softc->flags |= ADA_FLAG_CAN_DMA;
 	if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48)
 		softc->flags |= ADA_FLAG_CAN_48BIT;
 	if (cgd->ident_data.support.command2 & ATA_SUPPORT_FLUSHCACHE)
@@ -666,8 +644,8 @@ adaregister(struct cam_periph *periph, v
 	if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ &&
 	    cgd->ident_data.queue >= 31)
 		softc->flags |= ADA_FLAG_CAN_NCQ;
-//	if ((cgd->inq_data.flags & SID_CmdQue) != 0)
-//		softc->flags |= ADA_FLAG_TAGGED_QUEUING;
+	softc->secsperint = max(1, min(cgd->ident_data.sectors_intr, 16));
+	softc->state = ADA_STATE_SET_MULTI;
 
 	periph->softc = softc;
 
@@ -713,9 +691,9 @@ adaregister(struct cam_periph *periph, v
 	else if (maxio > MAXPHYS)
 		maxio = MAXPHYS;	/* for safety */
 	if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48)
-		maxio = min(maxio, 65535 * 512);
+		maxio = min(maxio, 65536 * 512);
 	else					/* 28bit ATA command limit */
-		maxio = min(maxio, 255 * 512);
+		maxio = min(maxio, 256 * 512);
 	softc->disk->d_maxsize = maxio;
 	softc->disk->d_unit = periph->unit_number;
 	softc->disk->d_flags = 0;
@@ -730,8 +708,6 @@ adaregister(struct cam_periph *periph, v
 	/* XXX: these are not actually "firmware" values, so they may be wrong */
 	softc->disk->d_fwsectors = softc->params.secs_per_track;
 	softc->disk->d_fwheads = softc->params.heads;
-//	softc->disk->d_devstat->block_size = softc->params.secsize;
-//	softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE;
 
 	disk_create(softc->disk, DISK_VERSION);
 	mtx_lock(periph->sim->mtx);
@@ -766,8 +742,8 @@ adaregister(struct cam_periph *periph, v
 	 * to finish the probe.  The reference will be dropped in adadone at
 	 * the end of probe.
 	 */
-//	(void)cam_periph_hold(periph, PRIBIO);
-//	xpt_schedule(periph, /*priority*/5);
+	cam_periph_acquire(periph);
+	xpt_schedule(periph, /*priority*/5);
 
 	/*
 	 * Schedule a periodic event to occasionally send an
@@ -784,9 +760,8 @@ adaregister(struct cam_periph *periph, v
 static void
 adastart(struct cam_periph *periph, union ccb *start_ccb)
 {
-	struct ada_softc *softc;
-
-	softc = (struct ada_softc *)periph->softc;
+	struct ada_softc *softc = (struct ada_softc *)periph->softc;
+	struct ccb_ataio *ataio = &start_ccb->ataio;
 
 	switch (softc->state) {
 	case ADA_STATE_NORMAL:
@@ -809,7 +784,6 @@ adastart(struct cam_periph *periph, unio
 		} else if (bp == NULL) {
 			xpt_release_ccb(start_ccb);
 		} else {
-			struct ccb_ataio *ataio = &start_ccb->ataio;
 			u_int8_t tag_code;
 
 			bioq_remove(&softc->bio_queue, bp);
@@ -817,9 +791,9 @@ adastart(struct cam_periph *periph, unio
 			if ((softc->flags & ADA_FLAG_NEED_OTAG) != 0) {
 				softc->flags &= ~ADA_FLAG_NEED_OTAG;
 				softc->ordered_tag_count++;
-				tag_code = 0;//MSG_ORDERED_Q_TAG;
+				tag_code = 0;
 			} else {
-				tag_code = 0;//MSG_SIMPLE_Q_TAG;
+				tag_code = 1;
 			}
 			switch (bp->bio_cmd) {
 			case BIO_READ:
@@ -838,7 +812,7 @@ adastart(struct cam_periph *periph, unio
 				    bp->bio_bcount,
 				    ada_default_timeout*1000);
 
-				if (softc->flags & ADA_FLAG_CAN_NCQ) {
+				if ((softc->flags & ADA_FLAG_CAN_NCQ) && tag_code) {
 					if (bp->bio_cmd == BIO_READ) {
 						ata_ncq_cmd(ataio, ATA_READ_FPDMA_QUEUED,
 						    lba, count);
@@ -848,21 +822,43 @@ adastart(struct cam_periph *periph, unio
 					}
 				} else if ((softc->flags & ADA_FLAG_CAN_48BIT) &&
 				    (lba + count >= ATA_MAX_28BIT_LBA ||
-				    count >= 256)) {
-					if (bp->bio_cmd == BIO_READ) {
-						ata_48bit_cmd(ataio, ATA_READ_DMA48,
-						    0, lba, count);
+				    count > 256)) {
+					if (softc->flags & ADA_FLAG_CAN_DMA) {
+						if (bp->bio_cmd == BIO_READ) {
+							ata_48bit_cmd(ataio, ATA_READ_DMA48,
+							    0, lba, count);
+						} else {
+							ata_48bit_cmd(ataio, ATA_WRITE_DMA48,
+							    0, lba, count);
+						}
 					} else {
-						ata_48bit_cmd(ataio, ATA_WRITE_DMA48,
-						    0, lba, count);
+						if (bp->bio_cmd == BIO_READ) {
+							ata_48bit_cmd(ataio, ATA_READ_MUL48,
+							    0, lba, count);
+						} else {
+							ata_48bit_cmd(ataio, ATA_WRITE_MUL48,
+							    0, lba, count);
+						}
 					}
 				} else {
-					if (bp->bio_cmd == BIO_READ) {
-						ata_28bit_cmd(ataio, ATA_READ_DMA,
-						    0, lba, count);
+					if (count == 256)
+						count = 0;
+					if (softc->flags & ADA_FLAG_CAN_DMA) {
+						if (bp->bio_cmd == BIO_READ) {
+							ata_28bit_cmd(ataio, ATA_READ_DMA,
+							    0, lba, count);
+						} else {
+							ata_28bit_cmd(ataio, ATA_WRITE_DMA,
+							    0, lba, count);
+						}
 					} else {
-						ata_28bit_cmd(ataio, ATA_WRITE_DMA,
-						    0, lba, count);
+						if (bp->bio_cmd == BIO_READ) {
+							ata_28bit_cmd(ataio, ATA_READ_MUL,
+							    0, lba, count);
+						} else {
+							ata_28bit_cmd(ataio, ATA_WRITE_MUL,
+							    0, lba, count);
+						}
 					}
 				}
 			}
@@ -872,7 +868,7 @@ adastart(struct cam_periph *periph, unio
 				    1,
 				    adadone,
 				    CAM_DIR_NONE,
-				    tag_code,
+				    0,
 				    NULL,
 				    0,
 				    ada_default_timeout*1000);
@@ -893,12 +889,6 @@ adastart(struct cam_periph *periph, unio
 					 &start_ccb->ccb_h, periph_links.le);
 			softc->outstanding_cmds++;
 
-			/* We expect a unit attention from this device */
-			if ((softc->flags & ADA_FLAG_RETRY_UA) != 0) {
-				start_ccb->ccb_h.ccb_state |= ADA_CCB_RETRY_UA;
-				softc->flags &= ~ADA_FLAG_RETRY_UA;
-			}
-
 			start_ccb->ccb_h.ccb_bp = bp;
 			bp = bioq_first(&softc->bio_queue);
 
@@ -911,6 +901,21 @@ adastart(struct cam_periph *periph, unio
 		}
 		break;
 	}
+	case ADA_STATE_SET_MULTI:
+	{
+		cam_fill_ataio(ataio,
+		    ada_retry_count,
+		    adadone,
+		    CAM_DIR_NONE,
+		    0,
+		    NULL,
+		    0,
+		    ada_default_timeout*1000);
+
+		ata_28bit_cmd(ataio, ATA_SET_MULTI, 0, 0, softc->secsperint);
+		start_ccb->ccb_h.ccb_state = ADA_CCB_SET_MULTI;
+		xpt_action(start_ccb);
+	}
 	}
 }
 
@@ -931,16 +936,12 @@ adadone(struct cam_periph *periph, union
 		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
 			int error;
 			
-			error = adaerror(done_ccb, CAM_RETRY_SELTO, 0);
+			error = adaerror(done_ccb, 0, 0);
 			if (error == ERESTART) {
-				/*
-				 * A retry was scheuled, so
-				 * just return.
-				 */
+				/* A retry was scheduled, so just return. */
 				return;
 			}
 			if (error != 0) {
-
 				if (error == ENXIO) {
 					/*
 					 * Catastrophic error.  Mark our pack as
@@ -1002,6 +1003,35 @@ adadone(struct cam_periph *periph, union
 		wakeup(&done_ccb->ccb_h.cbfcnp);
 		return;
 	}
+	case ADA_CCB_SET_MULTI:
+	{
+		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+		} else {
+			int	error;
+
+			error = adaerror(done_ccb, 0, 0);
+			if (error == ERESTART) {
+				/* A retry was scheduled, so just return. */
+				return;
+			}
+		}
+		softc->state = ADA_STATE_NORMAL;
+		/*
+		 * Since our peripheral may be invalidated by an error
+		 * above or an external event, we must release our CCB
+		 * before releasing the probe lock on the peripheral.
+		 * The peripheral will only go away once the last lock
+		 * is removed, and we need it around for the CCB release
+		 * operation.
+		 */
+		xpt_release_ccb(done_ccb);
+		if (bioq_first(&softc->bio_queue) != NULL) {
+			/* Have more work to do, so ensure we stay scheduled */
+			xpt_schedule(periph, 1);
+		}
+		cam_periph_release_locked(periph);
+		return;
+	}
 	case ADA_CCB_DUMP:
 		/* No-op.  We're polling */
 		return;
@@ -1049,10 +1079,6 @@ adasetgeom(struct cam_periph *periph, st
 	lbasize = (u_int32_t)cgd->ident_data.lba_size_1 |
 		  ((u_int32_t)cgd->ident_data.lba_size_2 << 16);
 
-    /* does this device need oldstyle CHS addressing */
-//    if (!ad_version(cgd->ident_data.version_major) || !lbasize)
-//	atadev->flags |= ATA_D_USE_CHS;
-
 	/* use the 28bit LBA size if valid or bigger than the CHS mapping */
 	if (cgd->ident_data.cylinders == 16383 || dp->sectors < lbasize)
 		dp->sectors = lbasize;

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 14:40:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 834541065670;
	Wed, 21 Oct 2009 14:40:22 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au
	[211.29.132.188])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A62F8FC0A;
	Wed, 21 Oct 2009 14:40:21 +0000 (UTC)
Received: from c122-106-156-249.carlnfd1.nsw.optusnet.com.au
	(c122-106-156-249.carlnfd1.nsw.optusnet.com.au [122.106.156.249])
	by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n9LEdbCd002651
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 22 Oct 2009 01:39:39 +1100
Date: Thu, 22 Oct 2009 01:39:37 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Bruce Evans 
In-Reply-To: <20091022005227.A12866@delplex.bde.org>
Message-ID: <20091022012525.D12905@delplex.bde.org>
References: <200910211015.n9LAFQwY094532@svn.freebsd.org>
	<20091021222805.I12783@delplex.bde.org>
	<7E425E81-2ACC-46F8-B864-169CDBFBB03B@elvandar.org>
	<20091022005227.A12866@delplex.bde.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, Remko Lodder ,
	Remko Lodder , src-committers@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r198316 - head/sbin/tunefs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 14:40:22 -0000

On Thu, 22 Oct 2009, Bruce Evans wrote:

> ...
> NetBSD's 2005 version says:
>
> % BUGS
> %      This program should work on mounted and active file systems.  Because 
> the
> %      super-block is not kept in the buffer cache, the changes will only 
> take
> %      effect if the program is run on unmounted file systems.  To change the
> %      root file system, the system must be rebooted after the file system is
> %      tuned.
>
> "mounted and active" is as unclear as "active".  The rotted words about
> rebooting seem to have come from here -- I just noticed that they are
> very recent additions to FreeBSD's tunefs.8.  They were added in 2007
> 8 years after they stopped applying.  Bah, they aren't evem wrong like
> that: allthough they are identical to NetBSD, they have a completely
> different meaning.  In NetBSD they are related to the buffer cache as
> dsecribed above, but in FreeBSD they are a special case for soft updates,
> as described only in their log message.  It takes a full mount to get the
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> soft updates flag looked at, so the remount done by tunefs doesn't work
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> for changes to the soft updates flag.

Actually, ffs_mount(...MNT_UPDATE...) looks at it and seems to partly
work.  I tried it with the file system mounted r/o (had to MNT_UPDATE
from r/w to r/o to run tunefs to test this).  Then MNT_UPDATE from
tunefs didn't give a soft update mount and didn't clear my async mount
flag according to mount(1), but a subsequent MNT_UPDATE to r/w did
(after manually clearing the async flag for safety).  Soft updates
then didn't cause any problems (didn't test enough to see if it really
worked).  Then turning of the soft updates flag using tunefs (after
MNT_UPDATE to r/o) didn't get rid of the soft updates mount after
various remounts.

I think the off->on transition of the soft updates flag is only seen
accidentally by some paths through ffs_mount(...MNT_UPDATE...) and this
transition should be avoided for all MNT_UPDATEs for safety, so tunefs
asking MNT_UPDATE to see it is dangerous.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 15:04:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FAF61065679;
	Wed, 21 Oct 2009 15:04:51 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E1198FC08;
	Wed, 21 Oct 2009 15:04:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LF4p0W002628;
	Wed, 21 Oct 2009 15:04:51 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LF4pJx002627;
	Wed, 21 Oct 2009 15:04:51 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910211504.n9LF4pJx002627@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 21 Oct 2009 15:04:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198329 - head/sys/dev/ips
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 15:04:51 -0000

Author: brueffer
Date: Wed Oct 21 15:04:50 2009
New Revision: 198329
URL: http://svn.freebsd.org/changeset/base/198329

Log:
  Check pointer for NULL before dereferencing it, not after.
  
  PR:		138384
  Submitted by:	Patroklos Argyroudis 
  MFC after:	1 week

Modified:
  head/sys/dev/ips/ips_disk.c

Modified: head/sys/dev/ips/ips_disk.c
==============================================================================
--- head/sys/dev/ips/ips_disk.c	Wed Oct 21 14:20:55 2009	(r198328)
+++ head/sys/dev/ips/ips_disk.c	Wed Oct 21 15:04:50 2009	(r198329)
@@ -192,10 +192,10 @@ ipsd_dump(void *arg, void *virtual, vm_o
 
 	dp = arg;
 	dsc = dp->d_drv1;
-	sc = dsc->sc;
 
 	if (dsc == NULL)
 		return (EINVAL);
+	sc = dsc->sc;
 
 	if (ips_get_free_cmd(sc, &command, 0) != 0) {
 		printf("ipsd: failed to get cmd for dump\n");

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 15:27:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 727B91065679;
	Wed, 21 Oct 2009 15:27:48 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 606078FC0C;
	Wed, 21 Oct 2009 15:27:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LFRm4e003098;
	Wed, 21 Oct 2009 15:27:48 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LFRm4h003095;
	Wed, 21 Oct 2009 15:27:48 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910211527.n9LFRm4h003095@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 21 Oct 2009 15:27:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198331 - in head/sys/cam: . ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 15:27:48 -0000

Author: mav
Date: Wed Oct 21 15:27:48 2009
New Revision: 198331
URL: http://svn.freebsd.org/changeset/base/198331

Log:
  MFp4:
  Separate CAM_DEV_IDENTIFY_DATA_VALID flag from CAM_DEV_INQUIRY_DATA_VALID.
  Add workaround for very old devices without support for mode setting.
  Add some PATA bus scanning support.
  Remove some SCSIsms.

Modified:
  head/sys/cam/ata/ata_xpt.c
  head/sys/cam/cam_xpt_internal.h

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Wed Oct 21 15:07:34 2009	(r198330)
+++ head/sys/cam/ata/ata_xpt.c	Wed Oct 21 15:27:48 2009	(r198331)
@@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 	/* for xpt_print below */
 #include "opt_cam.h"
@@ -755,11 +754,8 @@ probedone(struct cam_periph *periph, uni
 				    strlen(path->device->serial_num);
 			}
 
-			path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID;
-
-			scsi_find_quirk(path->device);
+			path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID;
 			ata_device_transport(path);
-
 			PROBE_SET_ACTION(softc, PROBE_SETMODE);
 			xpt_release_ccb(done_ccb);
 			xpt_schedule(periph, priority);
@@ -793,7 +789,7 @@ device_fail:
 	case PROBE_SETMODE:
 	{
 		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			if (path->device->protocol == PROTO_ATA) {
+modedone:		if (path->device->protocol == PROTO_ATA) {
 				path->device->flags &= ~CAM_DEV_UNCONFIGURED;
 				done_ccb->ccb_h.func_code = XPT_GDEV_TYPE;
 				xpt_action(done_ccb);
@@ -815,6 +811,10 @@ device_fail:
 			xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
 					 /*run_queue*/TRUE);
 		}
+		/* Old PIO2 devices may not support mode setting. */
+		if (ata_max_pmode(ident_buf) <= ATA_PIO2 &&
+		    (ident_buf->capabilities1 & ATA_SUPPORT_IORDY) == 0)
+			goto modedone;
 		goto device_fail;
 	}
 	case PROBE_INQUIRY:
@@ -854,8 +854,7 @@ device_fail:
 				}
 
 				scsi_find_quirk(path->device);
-
-//				scsi_devise_transport(path);
+				ata_device_transport(path);
 				path->device->flags &= ~CAM_DEV_UNCONFIGURED;
 				done_ccb->ccb_h.func_code = XPT_GDEV_TYPE;
 				xpt_action(done_ccb);
@@ -876,7 +875,7 @@ device_fail:
 	}
 	case PROBE_PM_PID:
 		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			if ((path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) == 0)
+			if ((path->device->flags & CAM_DEV_IDENTIFY_DATA_VALID) == 0)
 				bzero(ident_buf, sizeof(*ident_buf));
 			softc->pm_pid = (done_ccb->ataio.res.lba_high << 24) +
 			    (done_ccb->ataio.res.lba_mid << 16) +
@@ -940,7 +939,7 @@ device_fail:
 				softc->pm_ports = 5;
 			printf("PM ports: %d\n", softc->pm_ports);
 			ident_buf->config = softc->pm_ports;
-			path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID;
+			path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID;
 			softc->pm_step = 0;
 			PROBE_SET_ACTION(softc, PROBE_PM_RESET);
 			xpt_release_ccb(done_ccb);
@@ -1170,7 +1169,10 @@ ata_scan_bus(struct cam_periph *periph, 
 		}
 		scan_info->request_ccb = request_ccb;
 		scan_info->cpi = &work_ccb->cpi;
-		scan_info->found = 0x8001;
+		if (scan_info->cpi->transport == XPORT_ATA)
+			scan_info->found = 0x0003;
+		else
+			scan_info->found = 0x8001;
 		scan_info->counter = 0;
 		/* If PM supported, probe it first. */
 		if (scan_info->cpi->hba_inquiry & PI_SATAPM)
@@ -1400,68 +1402,29 @@ static void
 ata_device_transport(struct cam_path *path)
 {
 	struct ccb_pathinq cpi;
-//	struct ccb_trans_settings cts;
-	struct scsi_inquiry_data *inq_buf;
+	struct ccb_trans_settings cts;
+	struct scsi_inquiry_data *inq_buf = NULL;
+	struct ata_params *ident_buf = NULL;
 
 	/* Get transport information from the SIM */
 	xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
-	inq_buf = NULL;
-//	if ((path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0)
-//		inq_buf = &path->device->inq_data;
-//	path->device->protocol = cpi.protocol;
-//	path->device->protocol_version =
-//	    inq_buf != NULL ? SID_ANSI_REV(inq_buf) : cpi.protocol_version;
 	path->device->transport = cpi.transport;
-	path->device->transport_version = cpi.transport_version;
-#if 0
-	/*
-	 * Any device not using SPI3 features should
-	 * be considered SPI2 or lower.
-	 */
-	if (inq_buf != NULL) {
-		if (path->device->transport == XPORT_SPI
-		 && (inq_buf->spi3data & SID_SPI_MASK) == 0
-		 && path->device->transport_version > 2)
-			path->device->transport_version = 2;
-	} else {
-		struct cam_ed* otherdev;
-
-		for (otherdev = TAILQ_FIRST(&path->target->ed_entries);
-		     otherdev != NULL;
-		     otherdev = TAILQ_NEXT(otherdev, links)) {
-			if (otherdev != path->device)
-				break;
-		}
-
-		if (otherdev != NULL) {
-			/*
-			 * Initially assume the same versioning as
-			 * prior luns for this target.
-			 */
-			path->device->protocol_version =
-			    otherdev->protocol_version;
-			path->device->transport_version =
-			    otherdev->transport_version;
-		} else {
-			/* Until we know better, opt for safty */
-			path->device->protocol_version = 2;
-			if (path->device->transport == XPORT_SPI)
-				path->device->transport_version = 2;
-			else
-				path->device->transport_version = 0;
-		}
+	if ((path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0)
+		inq_buf = &path->device->inq_data;
+	if ((path->device->flags & CAM_DEV_IDENTIFY_DATA_VALID) != 0)
+		ident_buf = &path->device->ident_data;
+	if (path->device->protocol == PROTO_ATA) {
+		path->device->protocol_version = ident_buf ?
+		    ata_version(ident_buf->version_major) : cpi.protocol_version;
+	} else if (path->device->protocol == PROTO_SCSI) {
+		path->device->protocol_version = inq_buf ?
+		    SID_ANSI_REV(inq_buf) : cpi.protocol_version;
 	}
-
-	/*
-	 * XXX
-	 * For a device compliant with SPC-2 we should be able
-	 * to determine the transport version supported by
-	 * scrutinizing the version descriptors in the
-	 * inquiry buffer.
-	 */
+	path->device->transport_version = ident_buf ?
+	    ata_version(ident_buf->version_major) : cpi.transport_version;
 
 	/* Tell the controller what we think */
 	xpt_setup_ccb(&cts.ccb_h, path, /*priority*/1);
@@ -1474,7 +1437,6 @@ ata_device_transport(struct cam_path *pa
 	cts.proto_specific.valid = 0;
 	cts.xport_specific.valid = 0;
 	xpt_action((union ccb *)&cts);
-#endif
 }
 
 static void
@@ -1630,114 +1592,6 @@ scsi_set_transfer_settings(struct ccb_tr
 			scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
 	}
 
-	/* SPI specific sanity checking */
-	if (cts->transport == XPORT_SPI && async_update == FALSE) {
-		u_int spi3caps;
-		struct ccb_trans_settings_spi *spi;
-		struct ccb_trans_settings_spi *cur_spi;
-
-		spi = &cts->xport_specific.spi;
-
-		cur_spi = &cur_cts.xport_specific.spi;
-
-		/* Fill in any gaps in what the user gave us */
-		if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) == 0)
-			spi->sync_period = cur_spi->sync_period;
-		if ((cur_spi->valid & CTS_SPI_VALID_SYNC_RATE) == 0)
-			spi->sync_period = 0;
-		if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) == 0)
-			spi->sync_offset = cur_spi->sync_offset;
-		if ((cur_spi->valid & CTS_SPI_VALID_SYNC_OFFSET) == 0)
-			spi->sync_offset = 0;
-		if ((spi->valid & CTS_SPI_VALID_PPR_OPTIONS) == 0)
-			spi->ppr_options = cur_spi->ppr_options;
-		if ((cur_spi->valid & CTS_SPI_VALID_PPR_OPTIONS) == 0)
-			spi->ppr_options = 0;
-		if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) == 0)
-			spi->bus_width = cur_spi->bus_width;
-		if ((cur_spi->valid & CTS_SPI_VALID_BUS_WIDTH) == 0)
-			spi->bus_width = 0;
-		if ((spi->valid & CTS_SPI_VALID_DISC) == 0) {
-			spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB;
-			spi->flags |= cur_spi->flags & CTS_SPI_FLAGS_DISC_ENB;
-		}
-		if ((cur_spi->valid & CTS_SPI_VALID_DISC) == 0)
-			spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB;
-		if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0
-		  && (inq_data->flags & SID_Sync) == 0
-		  && cts->type == CTS_TYPE_CURRENT_SETTINGS)
-		 || ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0)) {
-			/* Force async */
-			spi->sync_period = 0;
-			spi->sync_offset = 0;
-		}
-
-		switch (spi->bus_width) {
-		case MSG_EXT_WDTR_BUS_32_BIT:
-			if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) == 0
-			  || (inq_data->flags & SID_WBus32) != 0
-			  || cts->type == CTS_TYPE_USER_SETTINGS)
-			 && (cpi.hba_inquiry & PI_WIDE_32) != 0)
-				break;
-			/* Fall Through to 16-bit */
-		case MSG_EXT_WDTR_BUS_16_BIT:
-			if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) == 0
-			  || (inq_data->flags & SID_WBus16) != 0
-			  || cts->type == CTS_TYPE_USER_SETTINGS)
-			 && (cpi.hba_inquiry & PI_WIDE_16) != 0) {
-				spi->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-				break;
-			}
-			/* Fall Through to 8-bit */
-		default: /* New bus width?? */
-		case MSG_EXT_WDTR_BUS_8_BIT:
-			/* All targets can do this */
-			spi->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-			break;
-		}
-
-		spi3caps = cpi.xport_specific.spi.ppr_options;
-		if ((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0
-		 && cts->type == CTS_TYPE_CURRENT_SETTINGS)
-			spi3caps &= inq_data->spi3data;
-
-		if ((spi3caps & SID_SPI_CLOCK_DT) == 0)
-			spi->ppr_options &= ~MSG_EXT_PPR_DT_REQ;
-
-		if ((spi3caps & SID_SPI_IUS) == 0)
-			spi->ppr_options &= ~MSG_EXT_PPR_IU_REQ;
-
-		if ((spi3caps & SID_SPI_QAS) == 0)
-			spi->ppr_options &= ~MSG_EXT_PPR_QAS_REQ;
-
-		/* No SPI Transfer settings are allowed unless we are wide */
-		if (spi->bus_width == 0)
-			spi->ppr_options = 0;
-
-		if ((spi->valid & CTS_SPI_VALID_DISC)
-		 && ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) == 0)) {
-			/*
-			 * Can't tag queue without disconnection.
-			 */
-			scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
-			scsi->valid |= CTS_SCSI_VALID_TQ;
-		}
-
-		/*
-		 * If we are currently performing tagged transactions to
-		 * this device and want to change its negotiation parameters,
-		 * go non-tagged for a bit to give the controller a chance to
-		 * negotiate unhampered by tag messages.
-		 */
-		if (cts->type == CTS_TYPE_CURRENT_SETTINGS
-		 && (device->inq_flags & SID_CmdQue) != 0
-		 && (scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0
-		 && (spi->flags & (CTS_SPI_VALID_SYNC_RATE|
-				   CTS_SPI_VALID_SYNC_OFFSET|
-				   CTS_SPI_VALID_BUS_WIDTH)) != 0)
-			scsi_toggle_tags(cts->ccb_h.path);
-	}
-
 	if (cts->type == CTS_TYPE_CURRENT_SETTINGS
 	 && (scsi->valid & CTS_SCSI_VALID_TQ) != 0) {
 		int device_tagenb;

Modified: head/sys/cam/cam_xpt_internal.h
==============================================================================
--- head/sys/cam/cam_xpt_internal.h	Wed Oct 21 15:07:34 2009	(r198330)
+++ head/sys/cam/cam_xpt_internal.h	Wed Oct 21 15:27:48 2009	(r198331)
@@ -116,6 +116,7 @@ struct cam_ed {
 #define CAM_DEV_INQUIRY_DATA_VALID	0x40
 #define	CAM_DEV_IN_DV			0x80
 #define	CAM_DEV_DV_HIT_BOTTOM		0x100
+#define CAM_DEV_IDENTIFY_DATA_VALID	0x200
 	u_int32_t	 tag_delay_count;
 #define	CAM_TAG_DELAY_COUNT		5
 	u_int32_t	 tag_saved_openings;

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 15:54:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B42911065670;
	Wed, 21 Oct 2009 15:54:45 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A2C808FC08;
	Wed, 21 Oct 2009 15:54:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LFsjC4003616;
	Wed, 21 Oct 2009 15:54:45 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LFsj9V003614;
	Wed, 21 Oct 2009 15:54:45 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910211554.n9LFsj9V003614@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 21 Oct 2009 15:54:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198332 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 15:54:45 -0000

Author: brueffer
Date: Wed Oct 21 15:54:45 2009
New Revision: 198332
URL: http://svn.freebsd.org/changeset/base/198332

Log:
  Check pointer for NULL before dereferencing it, not after.
  
  PR:		138383
  Submitted by:	Patroklos Argyroudis 
  Reviewed by:	rnoland
  MFC after:	1 week

Modified:
  head/sys/dev/drm/mach64_state.c

Modified: head/sys/dev/drm/mach64_state.c
==============================================================================
--- head/sys/dev/drm/mach64_state.c	Wed Oct 21 15:27:48 2009	(r198331)
+++ head/sys/dev/drm/mach64_state.c	Wed Oct 21 15:54:45 2009	(r198332)
@@ -826,7 +826,7 @@ int mach64_dma_vertex(struct drm_device 
 		      struct drm_file *file_priv)
 {
 	drm_mach64_private_t *dev_priv = dev->dev_private;
-	drm_mach64_sarea_t *sarea_priv = dev_priv->sarea_priv;
+	drm_mach64_sarea_t *sarea_priv;
 	drm_mach64_vertex_t *vertex = data;
 
 	LOCK_TEST_WITH_RETURN(dev, file_priv);
@@ -835,6 +835,7 @@ int mach64_dma_vertex(struct drm_device 
 		DRM_ERROR("called with no initialization\n");
 		return -EINVAL;
 	}
+	sarea_priv = dev_priv->sarea_priv;
 
 	DRM_DEBUG("pid=%d buf=%p used=%lu discard=%d\n",
 		  DRM_CURRENTPID,

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 15:57:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E1E431065672;
	Wed, 21 Oct 2009 15:57:16 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D109D8FC08;
	Wed, 21 Oct 2009 15:57:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LFvGfC003708;
	Wed, 21 Oct 2009 15:57:16 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LFvGEK003706;
	Wed, 21 Oct 2009 15:57:16 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910211557.n9LFvGEK003706@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 21 Oct 2009 15:57:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198333 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 15:57:17 -0000

Author: mav
Date: Wed Oct 21 15:57:16 2009
New Revision: 198333
URL: http://svn.freebsd.org/changeset/base/198333

Log:
  MFp4:
  Do not search for bus when it is not needed,

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Wed Oct 21 15:54:45 2009	(r198332)
+++ head/sys/cam/cam_xpt.c	Wed Oct 21 15:57:16 2009	(r198333)
@@ -4148,8 +4148,6 @@ xpt_release_simq(struct cam_sim *sim, in
 
 		sendq->qfrozen_cnt--;
 		if (sendq->qfrozen_cnt == 0) {
-			struct cam_eb *bus;
-
 			/*
 			 * If there is a timeout scheduled to release this
 			 * sim queue, remove it.  The queue frozen count is
@@ -4159,15 +4157,17 @@ xpt_release_simq(struct cam_sim *sim, in
 				callout_stop(&sim->callout);
 				sim->flags &= ~CAM_SIM_REL_TIMEOUT_PENDING;
 			}
-			bus = xpt_find_bus(sim->path_id);
 
 			if (run_queue) {
+				struct cam_eb *bus;
+
 				/*
 				 * Now that we are unfrozen run the send queue.
 				 */
+				bus = xpt_find_bus(sim->path_id);
 				xpt_run_dev_sendq(bus);
+				xpt_release_bus(bus);
 			}
-			xpt_release_bus(bus);
 		}
 	}
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 17:07:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67D591065670;
	Wed, 21 Oct 2009 17:07:46 +0000 (UTC)
	(envelope-from rdivacky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 572328FC1E;
	Wed, 21 Oct 2009 17:07:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LH7kh3005206;
	Wed, 21 Oct 2009 17:07:46 GMT
	(envelope-from rdivacky@svn.freebsd.org)
Received: (from rdivacky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LH7kHx005204;
	Wed, 21 Oct 2009 17:07:46 GMT
	(envelope-from rdivacky@svn.freebsd.org)
Message-Id: <200910211707.n9LH7kHx005204@svn.freebsd.org>
From: Roman Divacky 
Date: Wed, 21 Oct 2009 17:07:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198335 - head/share/mk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 17:07:46 -0000

Author: rdivacky
Date: Wed Oct 21 17:07:46 2009
New Revision: 198335
URL: http://svn.freebsd.org/changeset/base/198335

Log:
  Set CSTD in all cases except when CC=icc and NO_WARNS is set. This
  way we can set desired C standard even for cross tools etc.
  
  Tested by:	make universe
  Approved by:	ed (maintainer)
  OK by:		das

Modified:
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.sys.mk
==============================================================================
--- head/share/mk/bsd.sys.mk	Wed Oct 21 16:12:09 2009	(r198334)
+++ head/share/mk/bsd.sys.mk	Wed Oct 21 17:07:46 2009	(r198335)
@@ -11,7 +11,7 @@
 # the default is gnu99 for now
 CSTD		?= gnu99
 
-.if !defined(NO_WARNS) && ${CC} != "icc"
+.if !defined(NO_WARNS) || ${CC} != "icc"
 . if ${CSTD} == "k&r"
 CFLAGS		+= -traditional
 . elif ${CSTD} == "c89" || ${CSTD} == "c90"

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 18:09:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D075106566C;
	Wed, 21 Oct 2009 18:09:49 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7C43E8FC0C;
	Wed, 21 Oct 2009 18:09:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LI9nrF006572;
	Wed, 21 Oct 2009 18:09:49 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LI9nuC006571;
	Wed, 21 Oct 2009 18:09:49 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910211809.n9LI9nuC006571@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 21 Oct 2009 18:09:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198338 - head/sys/ia64/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 18:09:49 -0000

Author: marcel
Date: Wed Oct 21 18:09:48 2009
New Revision: 198338
URL: http://svn.freebsd.org/changeset/base/198338

Log:
  o   Align function on a 32-byte boundary so that the core's front-end
      can deliver 2 bundles per cycle to the back-end.
  o   Mark syscall stubs with a special unwind ABI tag so that unwind
      libraries know how to unwind.

Modified:
  head/sys/ia64/include/asm.h

Modified: head/sys/ia64/include/asm.h
==============================================================================
--- head/sys/ia64/include/asm.h	Wed Oct 21 17:18:48 2009	(r198337)
+++ head/sys/ia64/include/asm.h	Wed Oct 21 18:09:48 2009	(r198338)
@@ -61,7 +61,7 @@
  */
 #define	ENTRY(_name_, _n_args_)			\
 	.global	_name_;				\
-	.align	16;				\
+	.align	32;				\
 	.proc	_name_;				\
 _name_:;					\
 	.regstk	_n_args_, 0, 0, 0;		\
@@ -69,7 +69,7 @@ _name_:;					\
 
 #define	ENTRY_NOPROFILE(_name_, _n_args_)	\
 	.global	_name_;				\
-	.align	16;				\
+	.align	32;				\
 	.proc	_name_;				\
 _name_:;					\
 	.regstk	_n_args_, 0, 0, 0
@@ -79,7 +79,7 @@ _name_:;					\
  *	Declare a local leaf function.
  */
 #define STATIC_ENTRY(_name_, _n_args_)		\
-	.align	16;				\
+	.align	32;				\
 	.proc	_name_;				\
 _name_:;					\
 	.regstk	_n_args_, 0, 0, 0		\
@@ -161,6 +161,10 @@ label:	ASCIZ msg;				\
 #define	SYSCALLNUM(name)	SYS_ ## name
 
 #define	CALLSYS_NOERROR(name)					\
+	.prologue ;						\
+	.unwabi		@svr4, 'S' ;				\
+	.save		rp, r0 ;				\
+	.body ;							\
 {	.mmi ;							\
 	alloc		r9 = ar.pfs, 0, 0, 8, 0 ;		\
 	mov		r31 = ar.k5 ;				\

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 18:29:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7EDFC106568D;
	Wed, 21 Oct 2009 18:29:27 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6E9C78FC13;
	Wed, 21 Oct 2009 18:29:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LITRZl006961;
	Wed, 21 Oct 2009 18:29:27 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LITRt1006959;
	Wed, 21 Oct 2009 18:29:27 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <200910211829.n9LITRt1006959@svn.freebsd.org>
From: Fabien Thomas 
Date: Wed, 21 Oct 2009 18:29:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198339 - head/lib/libfetch
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 18:29:27 -0000

Author: fabient
Date: Wed Oct 21 18:29:26 2009
New Revision: 198339
URL: http://svn.freebsd.org/changeset/base/198339

Log:
  PR: 139751
  Approved by: des
  Obtained from: Xavier Heiny 
  MFC after: 3 weeks

Modified:
  head/lib/libfetch/common.c

Modified: head/lib/libfetch/common.c
==============================================================================
--- head/lib/libfetch/common.c	Wed Oct 21 18:09:48 2009	(r198338)
+++ head/lib/libfetch/common.c	Wed Oct 21 18:29:26 2009	(r198339)
@@ -772,7 +772,7 @@ fetch_no_proxy_match(const char *host)
 				break;
 
 		d_len = q - p;
-		if (d_len > 0 && h_len > d_len &&
+		if (d_len > 0 && h_len >= d_len &&
 		    strncasecmp(host + h_len - d_len,
 			p, d_len) == 0) {
 			/* domain name matches */

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 18:31:24 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C1A071065672;
	Wed, 21 Oct 2009 18:31:24 +0000 (UTC)
	(envelope-from rdivacky@vlk.vlakno.cz)
Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190])
	by mx1.freebsd.org (Postfix) with ESMTP id E35858FC17;
	Wed, 21 Oct 2009 18:31:23 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id DF70F9CB0CE;
	Wed, 21 Oct 2009 20:30:45 +0200 (CEST)
X-Virus-Scanned: amavisd-new at vlakno.cz
Received: from vlakno.cz ([127.0.0.1])
	by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Y0sSk-O4b5K2; Wed, 21 Oct 2009 20:30:43 +0200 (CEST)
Received: from vlk.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id AAECF9CB14A;
	Wed, 21 Oct 2009 20:30:43 +0200 (CEST)
Received: (from rdivacky@localhost)
	by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n9LIUhfL004919;
	Wed, 21 Oct 2009 20:30:43 +0200 (CEST) (envelope-from rdivacky)
Date: Wed, 21 Oct 2009 20:30:43 +0200
From: Roman Divacky 
To: Fabien Thomas 
Message-ID: <20091021183043.GA4224@freebsd.org>
References: <200910211829.n9LITRt1006959@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200910211829.n9LITRt1006959@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198339 - head/lib/libfetch
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 18:31:24 -0000

On Wed, Oct 21, 2009 at 06:29:27PM +0000, Fabien Thomas wrote:
> Author: fabient
> Date: Wed Oct 21 18:29:26 2009
> New Revision: 198339
> URL: http://svn.freebsd.org/changeset/base/198339
> 
> Log:
>   PR: 139751
>   Approved by: des
>   Obtained from: Xavier Heiny 
>   MFC after: 3 weeks

and where is the commit message?

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 18:31:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F34F81065692;
	Wed, 21 Oct 2009 18:31:54 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E34AC8FC1D;
	Wed, 21 Oct 2009 18:31:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LIVsqg007057;
	Wed, 21 Oct 2009 18:31:54 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LIVsHx007055;
	Wed, 21 Oct 2009 18:31:54 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200910211831.n9LIVsHx007055@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 21 Oct 2009 18:31:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198340 - head/sbin/sysctl
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 18:31:55 -0000

Author: ed
Date: Wed Oct 21 18:31:54 2009
New Revision: 198340
URL: http://svn.freebsd.org/changeset/base/198340

Log:
  Make input parsing in Farhenheit actually work.
  
  Don't clobber *p with '\0' when testing whether it has the value of 'F'.
  Just use the semantics of strtof() properly. If it returns p, we know
  that it parsed the string until it reached 'C' or 'F'.
  
  The code has not changed since it has been imported (r161951, Sep 3,
  2006).
  
  Submitted by:	Alexandre Perrin 
  MFC after:	1 week

Modified:
  head/sbin/sysctl/sysctl.c

Modified: head/sbin/sysctl/sysctl.c
==============================================================================
--- head/sbin/sysctl/sysctl.c	Wed Oct 21 18:29:26 2009	(r198339)
+++ head/sbin/sysctl/sysctl.c	Wed Oct 21 18:31:54 2009	(r198340)
@@ -68,7 +68,7 @@ static int	sysctl_all(int *oid, int len)
 static int	name2oid(char *, int *);
 
 static void	set_T_dev_t(char *, void **, size_t *);
-static int	set_IK(char *, int *);
+static int	set_IK(const char *, int *);
 
 static void
 usage(void)
@@ -452,19 +452,19 @@ set_T_dev_t(char *path, void **val, size
 }
 
 static int
-set_IK(char *str, int *val)
+set_IK(const char *str, int *val)
 {
 	float temp;
 	int len, kelv;
-	char *p, *endptr;
+	const char *p;
+	char *endptr;
 
 	if ((len = strlen(str)) == 0)
 		return (0);
 	p = &str[len - 1];
 	if (*p == 'C' || *p == 'F') {
-		*p = '\0';
 		temp = strtof(str, &endptr);
-		if (endptr == str || *endptr != '\0')
+		if (endptr == str || endptr != p)
 			return (0);
 		if (*p == 'F')
 			temp = (temp - 32) * 5 / 9;

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 18:38:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D8A34106568D;
	Wed, 21 Oct 2009 18:38:02 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C48298FC1B;
	Wed, 21 Oct 2009 18:38:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LIc25i007227;
	Wed, 21 Oct 2009 18:38:02 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LIc2wp007206;
	Wed, 21 Oct 2009 18:38:02 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910211838.n9LIc2wp007206@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 21 Oct 2009 18:38:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv
	i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim
	powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64
	sun4v/sun4v vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 18:38:02 -0000

Author: marcel
Date: Wed Oct 21 18:38:02 2009
New Revision: 198341
URL: http://svn.freebsd.org/changeset/base/198341

Log:
  o   Introduce vm_sync_icache() for making the I-cache coherent with
      the memory or D-cache, depending on the semantics of the platform.
      vm_sync_icache() is basically a wrapper around pmap_sync_icache(),
      that translates the vm_map_t argumument to pmap_t.
  o   Introduce pmap_sync_icache() to all PMAP implementation. For powerpc
      it replaces the pmap_page_executable() function, added to solve
      the I-cache problem in uiomove_fromphys().
  o   In proc_rwmem() call vm_sync_icache() when writing to a page that
      has execute permissions. This assures that when breakpoints are
      written, the I-cache will be coherent and the process will actually
      hit the breakpoint.
  o   This also fixes the Book-E PMAP implementation that was missing
      necessary locking while trying to deal with the I-cache coherency
      in pmap_enter() (read: mmu_booke_enter_locked).
  
  The key property of this change is that the I-cache is made coherent
  *after* writes have been done. Doing it in the PMAP layer when adding
  or changing a mapping means that the I-cache is made coherent *before*
  any writes happen. The difference is key when the I-cache prefetches.

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/arm/arm/pmap.c
  head/sys/arm/mv/mv_machdep.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c
  head/sys/ia64/ia64/pmap.c
  head/sys/kern/sys_process.c
  head/sys/mips/mips/pmap.c
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/booke/pmap.c
  head/sys/powerpc/include/pmap.h
  head/sys/powerpc/powerpc/mmu_if.m
  head/sys/powerpc/powerpc/pmap_dispatch.c
  head/sys/powerpc/powerpc/uio_machdep.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/sun4v/sun4v/pmap.c
  head/sys/vm/pmap.h
  head/sys/vm/vm_extern.h
  head/sys/vm/vm_glue.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/amd64/amd64/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -4810,6 +4810,11 @@ if (oldpmap)	/* XXX FIXME */
 	critical_exit();
 }
 
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+}
+
 /*
  *	Increase the starting virtual address of the given mapping if a
  *	different alignment might result in more superpage mappings.

Modified: head/sys/arm/arm/pmap.c
==============================================================================
--- head/sys/arm/arm/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/arm/arm/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -2863,14 +2863,14 @@ pmap_kenter_internal(vm_offset_t va, vm_
 	if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa))) {
 		vm_page_lock_queues();
 		if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva) {
-				/* release vm_page lock for pv_entry UMA */
+			/* release vm_page lock for pv_entry UMA */
 			vm_page_unlock_queues();
 			if ((pve = pmap_get_pv_entry()) == NULL)
 				panic("pmap_kenter_internal: no pv entries");	
 			vm_page_lock_queues();
 			PMAP_LOCK(pmap_kernel());
 			pmap_enter_pv(m, pve, pmap_kernel(), va,
-					 PVF_WRITE | PVF_UNMAN);
+			    PVF_WRITE | PVF_UNMAN);
 			pmap_fix_cache(m, pmap_kernel(), va);
 			PMAP_UNLOCK(pmap_kernel());
 		} else {
@@ -4567,6 +4567,12 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 }
 
 
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+}
+
+
 /*
  *	Increase the starting virtual address of the given mapping if a
  *	different alignment might result in more superpage mappings.

Modified: head/sys/arm/mv/mv_machdep.c
==============================================================================
--- head/sys/arm/mv/mv_machdep.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/arm/mv/mv_machdep.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -408,7 +408,7 @@ initarm(void *mdp, void *unused __unused
 		availmem_regions_sz = i;
 	} else {
 		/* Fall back to hardcoded boothowto flags and metadata. */
-		boothowto = RB_VERBOSE | RB_SINGLE;
+		boothowto = 0; // RB_VERBOSE | RB_SINGLE;
 		lastaddr = fake_preload_metadata();
 
 		/*

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/i386/i386/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -4859,6 +4859,11 @@ pmap_activate(struct thread *td)
 	critical_exit();
 }
 
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+}
+
 /*
  *	Increase the starting virtual address of the given mapping if a
  *	different alignment might result in more superpage mappings.

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/i386/xen/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -4175,6 +4175,11 @@ pmap_activate(struct thread *td)
 	critical_exit();
 }
 
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+}
+
 /*
  *	Increase the starting virtual address of the given mapping if a
  *	different alignment might result in more superpage mappings.

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/ia64/ia64/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -2276,6 +2276,33 @@ out:
 	return (prevpm);
 }
 
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+	pmap_t oldpm;
+	struct ia64_lpte *pte;
+	vm_offset_t lim;
+	vm_size_t len;
+
+	sz += va & 31;
+	va &= ~31;
+	sz = (sz + 31) & ~31;
+
+	PMAP_LOCK(pm);
+	oldpm = pmap_switch(pm);
+	while (sz > 0) {
+		lim = round_page(va);
+		len = MIN(lim - va, sz);
+		pte = pmap_find_vhpt(va);
+		if (pte != NULL && pmap_present(pte))
+			ia64_sync_icache(va, len);
+		va += len;
+		sz -= len;
+	}
+	pmap_switch(oldpm);
+	PMAP_UNLOCK(pm);
+}
+
 /*
  *	Increase the starting virtual address of the given mapping if a
  *	different alignment might result in more superpage mappings.

Modified: head/sys/kern/sys_process.c
==============================================================================
--- head/sys/kern/sys_process.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/kern/sys_process.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -327,6 +327,10 @@ proc_rwmem(struct proc *p, struct uio *u
 		 */
 		error = uiomove_fromphys(&m, page_offset, len, uio);
 
+		/* Make the I-cache coherent for breakpoints. */
+		if (!error && writing && (out_prot & VM_PROT_EXECUTE))
+			vm_sync_icache(map, uva, len);
+
 		/*
 		 * Release the page.
 		 */

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/mips/mips/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -2903,6 +2903,11 @@ pmap_activate(struct thread *td)
 	critical_exit();
 }
 
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+}
+
 /*
  *	Increase the starting virtual address of the given mapping if a
  *	different alignment might result in more superpage mappings.

Modified: head/sys/powerpc/aim/mmu_oea.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/powerpc/aim/mmu_oea.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -330,7 +330,7 @@ void moea_unmapdev(mmu_t, vm_offset_t, v
 vm_offset_t moea_kextract(mmu_t, vm_offset_t);
 void moea_kenter(mmu_t, vm_offset_t, vm_offset_t);
 boolean_t moea_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t);
-boolean_t moea_page_executable(mmu_t, vm_page_t);
+static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t);
 
 static mmu_method_t moea_methods[] = {
 	MMUMETHOD(mmu_change_wiring,	moea_change_wiring),
@@ -357,6 +357,7 @@ static mmu_method_t moea_methods[] = {
 	MMUMETHOD(mmu_remove,		moea_remove),
 	MMUMETHOD(mmu_remove_all,      	moea_remove_all),
 	MMUMETHOD(mmu_remove_write,	moea_remove_write),
+	MMUMETHOD(mmu_sync_icache,	moea_sync_icache),
 	MMUMETHOD(mmu_zero_page,       	moea_zero_page),
 	MMUMETHOD(mmu_zero_page_area,	moea_zero_page_area),
 	MMUMETHOD(mmu_zero_page_idle,	moea_zero_page_idle),
@@ -371,7 +372,6 @@ static mmu_method_t moea_methods[] = {
 	MMUMETHOD(mmu_kextract,		moea_kextract),
 	MMUMETHOD(mmu_kenter,		moea_kenter),
 	MMUMETHOD(mmu_dev_direct_mapped,moea_dev_direct_mapped),
-	MMUMETHOD(mmu_page_executable,	moea_page_executable),
 
 	{ 0, 0 }
 };
@@ -2359,12 +2359,6 @@ moea_dev_direct_mapped(mmu_t mmu, vm_off
 	return (EFAULT);
 }
 
-boolean_t
-moea_page_executable(mmu_t mmu, vm_page_t pg)
-{
-	return ((moea_attr_fetch(pg) & PTE_EXEC) == PTE_EXEC);
-}
-
 /*
  * Map a set of physical memory pages into the kernel virtual
  * address space. Return a pointer to where it is mapped. This
@@ -2424,3 +2418,27 @@ moea_unmapdev(mmu_t mmu, vm_offset_t va,
 		kmem_free(kernel_map, base, size);
 	}
 }
+
+static void
+moea_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+	struct pvo_entry *pvo;
+	vm_offset_t lim;
+	vm_paddr_t pa;
+	vm_size_t len;
+
+	PMAP_LOCK(pm);
+	while (sz > 0) {
+		lim = round_page(va);
+		len = MIN(lim - va, sz);
+		pvo = moea_pvo_find_va(pm, va & ~ADDR_POFF, NULL);
+		if (pvo != NULL) {
+			pa = (pvo->pvo_pte.pte.pte_lo & PTE_RPGN) |
+			    (va & ADDR_POFF);
+			moea_syncicache(pa, len);
+		}
+		va += len;
+		sz -= len;
+	}
+	PMAP_UNLOCK(pm);
+}

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/powerpc/aim/mmu_oea64.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -369,7 +369,7 @@ static boolean_t	moea64_query_bit(vm_pag
 static u_int		moea64_clear_bit(vm_page_t, u_int64_t, u_int64_t *);
 static void		moea64_kremove(mmu_t, vm_offset_t);
 static void		moea64_syncicache(pmap_t pmap, vm_offset_t va, 
-			    vm_offset_t pa);
+			    vm_offset_t pa, vm_size_t sz);
 static void		tlbia(void);
 
 /*
@@ -410,7 +410,7 @@ void moea64_unmapdev(mmu_t, vm_offset_t,
 vm_offset_t moea64_kextract(mmu_t, vm_offset_t);
 void moea64_kenter(mmu_t, vm_offset_t, vm_offset_t);
 boolean_t moea64_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t);
-boolean_t moea64_page_executable(mmu_t, vm_page_t);
+static void moea64_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t);
 
 static mmu_method_t moea64_bridge_methods[] = {
 	MMUMETHOD(mmu_change_wiring,	moea64_change_wiring),
@@ -437,6 +437,7 @@ static mmu_method_t moea64_bridge_method
 	MMUMETHOD(mmu_remove,		moea64_remove),
 	MMUMETHOD(mmu_remove_all,      	moea64_remove_all),
 	MMUMETHOD(mmu_remove_write,	moea64_remove_write),
+	MMUMETHOD(mmu_sync_icache,	moea64_sync_icache),
 	MMUMETHOD(mmu_zero_page,       	moea64_zero_page),
 	MMUMETHOD(mmu_zero_page_area,	moea64_zero_page_area),
 	MMUMETHOD(mmu_zero_page_idle,	moea64_zero_page_idle),
@@ -451,7 +452,6 @@ static mmu_method_t moea64_bridge_method
 	MMUMETHOD(mmu_kextract,		moea64_kextract),
 	MMUMETHOD(mmu_kenter,		moea64_kenter),
 	MMUMETHOD(mmu_dev_direct_mapped,moea64_dev_direct_mapped),
-	MMUMETHOD(mmu_page_executable,	moea64_page_executable),
 
 	{ 0, 0 }
 };
@@ -1264,12 +1264,12 @@ moea64_enter_locked(pmap_t pmap, vm_offs
 	 * mapped executable and cacheable.
 	 */
 	if ((pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) {
-		moea64_syncicache(pmap, va, VM_PAGE_TO_PHYS(m));
+		moea64_syncicache(pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE);
 	}
 }
 
 static void
-moea64_syncicache(pmap_t pmap, vm_offset_t va, vm_offset_t pa)
+moea64_syncicache(pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_size_t sz)
 {
 	/*
 	 * This is much trickier than on older systems because
@@ -1285,16 +1285,16 @@ moea64_syncicache(pmap_t pmap, vm_offset
 		 * If PMAP is not bootstrapped, we are likely to be
 		 * in real mode.
 		 */
-		__syncicache((void *)pa,PAGE_SIZE);
+		__syncicache((void *)pa, sz);
 	} else if (pmap == kernel_pmap) {
-		__syncicache((void *)va,PAGE_SIZE);
+		__syncicache((void *)va, sz);
 	} else {
 		/* Use the scratch page to set up a temp mapping */
 
 		mtx_lock(&moea64_scratchpage_mtx);
 
 		moea64_set_scratchpage_pa(1,pa);
-		__syncicache((void *)moea64_scratchpage_va[1],PAGE_SIZE);
+		__syncicache((void *)moea64_scratchpage_va[1], sz);
 
 		mtx_unlock(&moea64_scratchpage_mtx);
 	}
@@ -1817,8 +1817,9 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_
 			    pvo->pvo_pmap, pvo->pvo_vaddr);
 			if ((pvo->pvo_pte.lpte.pte_lo & 
 			    (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) {
-				moea64_syncicache(pm, sva, 
-				     pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN);
+				moea64_syncicache(pm, sva,
+				    pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN,
+				    PAGE_SIZE);
 			}
 		}
 		UNLOCK_TABLE();
@@ -2406,12 +2407,6 @@ moea64_dev_direct_mapped(mmu_t mmu, vm_o
 	return (EFAULT);
 }
 
-boolean_t
-moea64_page_executable(mmu_t mmu, vm_page_t pg)
-{
-	return (!moea64_query_bit(pg, LPTE_NOEXEC));
-}
-
 /*
  * Map a set of physical memory pages into the kernel virtual
  * address space. Return a pointer to where it is mapped. This
@@ -2454,3 +2449,26 @@ moea64_unmapdev(mmu_t mmu, vm_offset_t v
 	kmem_free(kernel_map, base, size);
 }
 
+static void
+moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+	struct pvo_entry *pvo;
+	vm_offset_t lim;
+	vm_paddr_t pa;
+	vm_size_t len;
+
+	PMAP_LOCK(pm);
+	while (sz > 0) {
+		lim = round_page(va);
+		len = MIN(lim - va, sz);
+		pvo = moea64_pvo_find_va(pm, va & ~ADDR_POFF, NULL);
+		if (pvo != NULL) {
+			pa = (pvo->pvo_pte.pte.pte_lo & PTE_RPGN) |
+			    (va & ADDR_POFF);
+			moea64_syncicache(pm, va, pa, len);
+		}
+		va += len;
+		sz -= len;
+	}
+	PMAP_UNLOCK(pm);
+}

Modified: head/sys/powerpc/booke/pmap.c
==============================================================================
--- head/sys/powerpc/booke/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/powerpc/booke/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -319,7 +319,8 @@ static vm_offset_t	mmu_booke_kextract(mm
 static void		mmu_booke_kenter(mmu_t, vm_offset_t, vm_offset_t);
 static void		mmu_booke_kremove(mmu_t, vm_offset_t);
 static boolean_t	mmu_booke_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t);
-static boolean_t	mmu_booke_page_executable(mmu_t, vm_page_t);
+static void		mmu_booke_sync_icache(mmu_t, pmap_t, vm_offset_t,
+    vm_size_t);
 static vm_offset_t	mmu_booke_dumpsys_map(mmu_t, struct pmap_md *,
     vm_size_t, vm_size_t *);
 static void		mmu_booke_dumpsys_unmap(mmu_t, struct pmap_md *,
@@ -357,6 +358,7 @@ static mmu_method_t mmu_booke_methods[] 
 	MMUMETHOD(mmu_remove,		mmu_booke_remove),
 	MMUMETHOD(mmu_remove_all,	mmu_booke_remove_all),
 	MMUMETHOD(mmu_remove_write,	mmu_booke_remove_write),
+	MMUMETHOD(mmu_sync_icache,	mmu_booke_sync_icache),
 	MMUMETHOD(mmu_zero_page,	mmu_booke_zero_page),
 	MMUMETHOD(mmu_zero_page_area,	mmu_booke_zero_page_area),
 	MMUMETHOD(mmu_zero_page_idle,	mmu_booke_zero_page_idle),
@@ -370,7 +372,6 @@ static mmu_method_t mmu_booke_methods[] 
 	MMUMETHOD(mmu_kenter,		mmu_booke_kenter),
 	MMUMETHOD(mmu_kextract,		mmu_booke_kextract),
 /*	MMUMETHOD(mmu_kremove,		mmu_booke_kremove),	*/
-	MMUMETHOD(mmu_page_executable,	mmu_booke_page_executable),
 	MMUMETHOD(mmu_unmapdev,		mmu_booke_unmapdev),
 
 	/* dumpsys() support */
@@ -1682,21 +1683,6 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t
 		__syncicache((void *)va, PAGE_SIZE);
 		sync = 0;
 	}
-
-	if (sync) {
-		/* Create a temporary mapping. */
-		pmap = PCPU_GET(curpmap);
-
-		va = 0;
-		pte = pte_find(mmu, pmap, va);
-		KASSERT(pte == NULL, ("%s:%d", __func__, __LINE__));
-
-		flags = PTE_SR | PTE_VALID | PTE_UR | PTE_M;
-		
-		pte_enter(mmu, pmap, m, va, flags);
-		__syncicache((void *)va, PAGE_SIZE);
-		pte_remove(mmu, pmap, va, PTBL_UNHOLD);
-	}
 }
 
 /*
@@ -1991,25 +1977,47 @@ mmu_booke_remove_write(mmu_t mmu, vm_pag
 	vm_page_flag_clear(m, PG_WRITEABLE);
 }
 
-static boolean_t
-mmu_booke_page_executable(mmu_t mmu, vm_page_t m)
+static void
+mmu_booke_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz)
 {
-	pv_entry_t pv;
 	pte_t *pte;
-	boolean_t executable;
+	pmap_t pmap;
+	vm_page_t m;
+	vm_offset_t addr;
+	vm_paddr_t pa;
+	int active, valid;
+ 
+	va = trunc_page(va);
+	sz = round_page(sz);
 
-	executable = FALSE;
-	TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) {
-		PMAP_LOCK(pv->pv_pmap);
-		pte = pte_find(mmu, pv->pv_pmap, pv->pv_va);
-		if (pte != NULL && PTE_ISVALID(pte) && (pte->flags & PTE_UX))
-			executable = TRUE;
-		PMAP_UNLOCK(pv->pv_pmap);
-		if (executable)
-			break;
+	vm_page_lock_queues();
+	pmap = PCPU_GET(curpmap);
+	active = (pm == kernel_pmap || pm == pmap) ? 1 : 0;
+	while (sz > 0) {
+		PMAP_LOCK(pm);
+		pte = pte_find(mmu, pm, va);
+		valid = (pte != NULL && PTE_ISVALID(pte)) ? 1 : 0;
+		if (valid)
+			pa = PTE_PA(pte);
+		PMAP_UNLOCK(pm);
+		if (valid) {
+			if (!active) {
+				/* Create a mapping in the active pmap. */
+				addr = 0;
+				m = PHYS_TO_VM_PAGE(pa);
+				PMAP_LOCK(pmap);
+				pte_enter(mmu, pmap, m, addr,
+				    PTE_SR | PTE_VALID | PTE_UR);
+				__syncicache((void *)addr, PAGE_SIZE);
+				pte_remove(mmu, pmap, addr, PTBL_UNHOLD);
+				PMAP_UNLOCK(pmap);
+			} else
+				__syncicache((void *)va, PAGE_SIZE);
+		}
+		va += PAGE_SIZE;
+		sz -= PAGE_SIZE;
 	}
-
-	return (executable);
+	vm_page_unlock_queues();
 }
 
 /*

Modified: head/sys/powerpc/include/pmap.h
==============================================================================
--- head/sys/powerpc/include/pmap.h	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/powerpc/include/pmap.h	Wed Oct 21 18:38:02 2009	(r198341)
@@ -171,7 +171,6 @@ void		pmap_bootstrap(vm_offset_t, vm_off
 void		pmap_kenter(vm_offset_t va, vm_offset_t pa);
 void		pmap_kremove(vm_offset_t);
 void		*pmap_mapdev(vm_offset_t, vm_size_t);
-boolean_t	pmap_page_executable(vm_page_t);
 void		pmap_unmapdev(vm_offset_t, vm_size_t);
 void		pmap_deactivate(struct thread *);
 vm_offset_t	pmap_kextract(vm_offset_t);

Modified: head/sys/powerpc/powerpc/mmu_if.m
==============================================================================
--- head/sys/powerpc/powerpc/mmu_if.m	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/powerpc/powerpc/mmu_if.m	Wed Oct 21 18:38:02 2009	(r198341)
@@ -789,15 +789,21 @@ METHOD boolean_t dev_direct_mapped {
 
 
 /**
- * @brief Evaluate if a physical page has an executable mapping
- *
- * @param _pg		physical page
- *
- * @retval bool		TRUE if a physical mapping exists for the given page.
+ * @brief Enforce instruction cache coherency. Typically called after a
+ * region of memory has been modified and before execution of or within
+ * that region is attempted. Setting breakpoints in a process through
+ * ptrace(2) is one example of when the instruction cache needs to be
+ * made coherent.
+ *
+ * @param _pm		the physical map of the virtual address
+ * @param _va		the virtual address of the modified region
+ * @param _sz		the size of the modified region
  */
-METHOD boolean_t page_executable {
+METHOD void sync_icache {
 	mmu_t		_mmu;
-	vm_page_t	_pg;
+	pmap_t		_pm;
+	vm_offset_t	_va;
+	vm_size_t	_sz;
 };
 
 

Modified: head/sys/powerpc/powerpc/pmap_dispatch.c
==============================================================================
--- head/sys/powerpc/powerpc/pmap_dispatch.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/powerpc/powerpc/pmap_dispatch.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -457,12 +457,12 @@ pmap_dev_direct_mapped(vm_offset_t pa, v
 	return (MMU_DEV_DIRECT_MAPPED(mmu_obj, pa, size));
 }
 
-boolean_t
-pmap_page_executable(vm_page_t pg)
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
 {
-
-	CTR2(KTR_PMAP, "%s(%p)", __func__, pg);
-	return (MMU_PAGE_EXECUTABLE(mmu_obj, pg));
+ 
+	CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pm, va, sz);
+	return (MMU_SYNC_ICACHE(mmu_obj, pm, va, sz));
 }
 
 vm_offset_t

Modified: head/sys/powerpc/powerpc/uio_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/uio_machdep.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/powerpc/powerpc/uio_machdep.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -107,9 +107,6 @@ uiomove_fromphys(vm_page_t ma[], vm_offs
 					sf_buf_free(sf);
 					goto out;
 				}
-				if (uio->uio_rw == UIO_WRITE &&
-				    pmap_page_executable(m))
-					__syncicache(cp, cnt);
 				break;
 			case UIO_SYSSPACE:
 				if (uio->uio_rw == UIO_READ)

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/sparc64/sparc64/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -2001,6 +2001,11 @@ pmap_activate(struct thread *td)
 	mtx_unlock_spin(&sched_lock);
 }
 
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+}
+
 /*
  * Increase the starting virtual address of the given mapping if a
  * different alignment might result in more superpage mappings.

Modified: head/sys/sun4v/sun4v/pmap.c
==============================================================================
--- head/sys/sun4v/sun4v/pmap.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/sun4v/sun4v/pmap.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -424,6 +424,11 @@ pmap_activate(struct thread *td)
 	critical_exit();
 }
 
+void
+pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
+{
+}
+
 /*
  *	Increase the starting virtual address of the given mapping if a
  *	different alignment might result in more superpage mappings.

Modified: head/sys/vm/pmap.h
==============================================================================
--- head/sys/vm/pmap.h	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/vm/pmap.h	Wed Oct 21 18:38:02 2009	(r198341)
@@ -133,6 +133,7 @@ void		 pmap_remove(pmap_t, vm_offset_t, 
 void		 pmap_remove_all(vm_page_t m);
 void		 pmap_remove_pages(pmap_t);
 void		 pmap_remove_write(vm_page_t m);
+void		 pmap_sync_icache(pmap_t, vm_offset_t, vm_size_t);
 void		 pmap_zero_page(vm_page_t);
 void		 pmap_zero_page_area(vm_page_t, int off, int size);
 void		 pmap_zero_page_idle(vm_page_t);

Modified: head/sys/vm/vm_extern.h
==============================================================================
--- head/sys/vm/vm_extern.h	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/vm/vm_extern.h	Wed Oct 21 18:38:02 2009	(r198341)
@@ -63,6 +63,7 @@ int vm_forkproc(struct thread *, struct 
 void vm_waitproc(struct proc *);
 int vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, objtype_t, void *, vm_ooffset_t);
 void vm_set_page_size(void);
+void vm_sync_icache(vm_map_t, vm_offset_t, vm_size_t);
 struct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t);
 struct vmspace *vmspace_fork(struct vmspace *, vm_ooffset_t *);
 int vmspace_exec(struct proc *, vm_offset_t, vm_offset_t);

Modified: head/sys/vm/vm_glue.c
==============================================================================
--- head/sys/vm/vm_glue.c	Wed Oct 21 18:31:54 2009	(r198340)
+++ head/sys/vm/vm_glue.c	Wed Oct 21 18:38:02 2009	(r198341)
@@ -309,6 +309,13 @@ vm_imgact_unmap_page(struct sf_buf *sf)
 	vm_page_unlock_queues();
 }
 
+void
+vm_sync_icache(vm_map_t map, vm_offset_t va, vm_offset_t sz)
+{
+
+	pmap_sync_icache(map->pmap, va, sz);
+}
+
 struct kstack_cache_entry {
 	vm_object_t ksobj;
 	struct kstack_cache_entry *next_ks_entry;

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 18:40:33 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 20FD31065670;
	Wed, 21 Oct 2009 18:40:33 +0000 (UTC)
	(envelope-from rdivacky@vlk.vlakno.cz)
Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190])
	by mx1.freebsd.org (Postfix) with ESMTP id C8B718FC1E;
	Wed, 21 Oct 2009 18:40:32 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id 213489CB0CE;
	Wed, 21 Oct 2009 20:39:55 +0200 (CEST)
X-Virus-Scanned: amavisd-new at vlakno.cz
Received: from vlakno.cz ([127.0.0.1])
	by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id ud2kDiZVAQ27; Wed, 21 Oct 2009 20:39:52 +0200 (CEST)
Received: from vlk.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id BDEE59CB515;
	Wed, 21 Oct 2009 20:39:52 +0200 (CEST)
Received: (from rdivacky@localhost)
	by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n9LIdqmc006191;
	Wed, 21 Oct 2009 20:39:52 +0200 (CEST) (envelope-from rdivacky)
Date: Wed, 21 Oct 2009 20:39:52 +0200
From: Roman Divacky 
To: Marcel Moolenaar 
Message-ID: <20091021183952.GA5953@freebsd.org>
References: <200910211838.n9LIc2wp007206@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200910211838.n9LIc2wp007206@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv
	i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim
	powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64
	sun4v/sun4v vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 18:40:33 -0000

> 
> Modified: head/sys/arm/mv/mv_machdep.c
> ==============================================================================
> --- head/sys/arm/mv/mv_machdep.c	Wed Oct 21 18:31:54 2009	(r198340)
> +++ head/sys/arm/mv/mv_machdep.c	Wed Oct 21 18:38:02 2009	(r198341)
> @@ -408,7 +408,7 @@ initarm(void *mdp, void *unused __unused
>  		availmem_regions_sz = i;
>  	} else {
>  		/* Fall back to hardcoded boothowto flags and metadata. */
> -		boothowto = RB_VERBOSE | RB_SINGLE;
> +		boothowto = 0; // RB_VERBOSE | RB_SINGLE;

are you sure about this?

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 18:44:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A0051065694;
	Wed, 21 Oct 2009 18:44:01 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 299C28FC19;
	Wed, 21 Oct 2009 18:44:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LIi1mO007443;
	Wed, 21 Oct 2009 18:44:01 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LIi1Ji007441;
	Wed, 21 Oct 2009 18:44:01 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910211844.n9LIi1Ji007441@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 21 Oct 2009 18:44:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198342 - head/sys/arm/mv
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 18:44:01 -0000

Author: marcel
Date: Wed Oct 21 18:44:00 2009
New Revision: 198342
URL: http://svn.freebsd.org/changeset/base/198342

Log:
  Review previous change. It has no relation to the I-cache coherency
  changes and thus unintentional.
  
  Spotted by: rdivacky@

Modified:
  head/sys/arm/mv/mv_machdep.c

Modified: head/sys/arm/mv/mv_machdep.c
==============================================================================
--- head/sys/arm/mv/mv_machdep.c	Wed Oct 21 18:38:02 2009	(r198341)
+++ head/sys/arm/mv/mv_machdep.c	Wed Oct 21 18:44:00 2009	(r198342)
@@ -408,7 +408,7 @@ initarm(void *mdp, void *unused __unused
 		availmem_regions_sz = i;
 	} else {
 		/* Fall back to hardcoded boothowto flags and metadata. */
-		boothowto = 0; // RB_VERBOSE | RB_SINGLE;
+		boothowto = RB_VERBOSE | RB_SINGLE;
 		lastaddr = fake_preload_metadata();
 
 		/*

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 18:46:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1FB421065670;
	Wed, 21 Oct 2009 18:46:37 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0F5758FC15;
	Wed, 21 Oct 2009 18:46:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LIkaPs007540;
	Wed, 21 Oct 2009 18:46:36 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LIkaDK007538;
	Wed, 21 Oct 2009 18:46:36 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <200910211846.n9LIkaDK007538@svn.freebsd.org>
From: Fabien Thomas 
Date: Wed, 21 Oct 2009 18:46:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198343 - head/sys/dev/hwpmc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 18:46:37 -0000

Author: fabient
Date: Wed Oct 21 18:46:36 2009
New Revision: 198343
URL: http://svn.freebsd.org/changeset/base/198343

Log:
  Handle the case where there is only one PMC in the system.
  
  Approved by: jkoshy (mentor)
  MFC after: 3 days

Modified:
  head/sys/dev/hwpmc/hwpmc_mod.c

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_mod.c	Wed Oct 21 18:44:00 2009	(r198342)
+++ head/sys/dev/hwpmc/hwpmc_mod.c	Wed Oct 21 18:46:36 2009	(r198343)
@@ -790,7 +790,7 @@ pmc_link_target_process(struct pmc *pm, 
 	KASSERT(PMC_IS_VIRTUAL_MODE(PMC_TO_MODE(pm)),
 	    ("[pmc,%d] Attaching a non-process-virtual pmc=%p to pid=%d",
 		__LINE__, pm, pp->pp_proc->p_pid));
-	KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < ((int) md->pmd_npmc - 1),
+	KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= ((int) md->pmd_npmc - 1),
 	    ("[pmc,%d] Illegal reference count %d for process record %p",
 		__LINE__, pp->pp_refcnt, (void *) pp));
 
@@ -843,7 +843,7 @@ pmc_unlink_target_process(struct pmc *pm
 	KASSERT(pm != NULL && pp != NULL,
 	    ("[pmc,%d] Null pm %p or pp %p", __LINE__, pm, pp));
 
-	KASSERT(pp->pp_refcnt >= 1 && pp->pp_refcnt < (int) md->pmd_npmc,
+	KASSERT(pp->pp_refcnt >= 1 && pp->pp_refcnt <= (int) md->pmd_npmc,
 	    ("[pmc,%d] Illegal ref count %d on process record %p",
 		__LINE__, pp->pp_refcnt, (void *) pp));
 
@@ -1110,7 +1110,7 @@ pmc_detach_one_process(struct proc *p, s
 	 * descriptor from the target hash table and unset the P_HWPMC
 	 * flag in the struct proc.
 	 */
-	KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < (int) md->pmd_npmc,
+	KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= (int) md->pmd_npmc,
 	    ("[pmc,%d] Illegal refcnt %d for process struct %p",
 		__LINE__, pp->pp_refcnt, pp));
 
@@ -1785,7 +1785,7 @@ pmc_hook_handler(struct thread *td, int 
 					pmc_detach_one_process(td->td_proc,
 					    pm, PMC_FLAG_NONE);
 
-		KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < (int) md->pmd_npmc,
+		KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= (int) md->pmd_npmc,
 		    ("[pmc,%d] Illegal ref count %d on pp %p", __LINE__,
 			pp->pp_refcnt, pp));
 

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 19:24:47 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D2CF1065670;
	Wed, 21 Oct 2009 19:24:47 +0000 (UTC)
	(envelope-from fabien.thomas@netasq.com)
Received: from netasq.netasq.com (netasq.netasq.com [213.30.137.178])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B9458FC14;
	Wed, 21 Oct 2009 19:24:46 +0000 (UTC)
Received: from [192.168.0.1] (unknown [172.16.0.46])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(Client did not present a certificate)
	by netasq.netasq.com (Postfix) with ESMTP
	id 5184CC811E; Wed, 21 Oct 2009 20:55:54 +0200 (CEST)
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=iso-8859-1; format=flowed
From: Fabien THOMAS 
In-Reply-To: <20091021183043.GA4224@freebsd.org>
Date: Wed, 21 Oct 2009 20:56:37 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <200910211829.n9LITRt1006959@svn.freebsd.org>
	<20091021183043.GA4224@freebsd.org>
To: Roman Divacky 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Fabien Thomas 
Subject: Re: svn commit: r198339 - head/lib/libfetch
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 19:24:47 -0000

oops sorry...
is it possible to change it?

Changing revision properties is prohibited

Le 21 oct. 2009 =E0 20:30, Roman Divacky a =E9crit :

> On Wed, Oct 21, 2009 at 06:29:27PM +0000, Fabien Thomas wrote:
>> Author: fabient
>> Date: Wed Oct 21 18:29:26 2009
>> New Revision: 198339
>> URL: http://svn.freebsd.org/changeset/base/198339
>>
>> Log:
>>  PR: 139751
>>  Approved by: des
>>  Obtained from: Xavier Heiny 
>>  MFC after: 3 weeks
>
> and where is the commit message?
>


From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 19:26:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76CC3106568D;
	Wed, 21 Oct 2009 19:26:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 66CB28FC1A;
	Wed, 21 Oct 2009 19:26:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LJQD7P008374;
	Wed, 21 Oct 2009 19:26:13 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LJQDYF008372;
	Wed, 21 Oct 2009 19:26:13 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910211926.n9LJQDYF008372@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 21 Oct 2009 19:26:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198344 - head/contrib/gcc/config/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 19:26:13 -0000

Author: jhb
Date: Wed Oct 21 19:26:12 2009
New Revision: 198344
URL: http://svn.freebsd.org/changeset/base/198344

Log:
  Change gcc to assume a default machine architecture of 486 instead of 386
  on "i386".  Doing it in the compiler is deemed to be less fragile then
  attempting to provide a default -march setting via bsd.cpu.mk.  FreeBSD
  itself has not supported plain 386 CPUs since 5.x.
  
  Suggested by:	kan
  Requested by:	rdivacky
  MFC after:	1 month

Modified:
  head/contrib/gcc/config/i386/i386.c

Modified: head/contrib/gcc/config/i386/i386.c
==============================================================================
--- head/contrib/gcc/config/i386/i386.c	Wed Oct 21 18:46:36 2009	(r198343)
+++ head/contrib/gcc/config/i386/i386.c	Wed Oct 21 19:26:12 2009	(r198344)
@@ -1614,7 +1614,7 @@ override_options (void)
 	     "-mtune=generic instead as appropriate.");
 
   if (!ix86_arch_string)
-    ix86_arch_string = TARGET_64BIT ? "x86-64" : "i386";
+    ix86_arch_string = TARGET_64BIT ? "x86-64" : "i486";
   if (!strcmp (ix86_arch_string, "generic"))
     error ("generic CPU can be used only for -mtune= switch");
   if (!strncmp (ix86_arch_string, "generic", 7))

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 19:31:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E95DE1065676;
	Wed, 21 Oct 2009 19:31:23 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D9A038FC15;
	Wed, 21 Oct 2009 19:31:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LJVNWl008532;
	Wed, 21 Oct 2009 19:31:23 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LJVN1R008530;
	Wed, 21 Oct 2009 19:31:23 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910211931.n9LJVN1R008530@svn.freebsd.org>
From: Rui Paulo 
Date: Wed, 21 Oct 2009 19:31:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198346 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 19:31:24 -0000

Author: rpaulo
Date: Wed Oct 21 19:31:23 2009
New Revision: 198346
URL: http://svn.freebsd.org/changeset/base/198346

Log:
  Don't call the newstate callback as that's dangerous. Rely no ENETRESET
  to DTRT.
  
  MFC after:	3 days

Modified:
  head/sys/net80211/ieee80211_mesh.c

Modified: head/sys/net80211/ieee80211_mesh.c
==============================================================================
--- head/sys/net80211/ieee80211_mesh.c	Wed Oct 21 19:29:05 2009	(r198345)
+++ head/sys/net80211/ieee80211_mesh.c	Wed Oct 21 19:31:23 2009	(r198346)
@@ -388,8 +388,6 @@ mesh_select_proto_path(struct ieee80211v
 	for (i = 0; i < N(mesh_proto_paths); i++) {
 		if (strcasecmp(mesh_proto_paths[i].mpp_descr, name) == 0) {
 			ms->ms_ppath = &mesh_proto_paths[i];
-			if (vap->iv_state == IEEE80211_S_RUN)
-				vap->iv_newstate(vap, IEEE80211_S_INIT, 0);
 			return 0;
 		}
 	}
@@ -405,8 +403,6 @@ mesh_select_proto_metric(struct ieee8021
 	for (i = 0; i < N(mesh_proto_metrics); i++) {
 		if (strcasecmp(mesh_proto_metrics[i].mpm_descr, name) == 0) {
 			ms->ms_pmetric = &mesh_proto_metrics[i];
-			if (vap->iv_state == IEEE80211_S_RUN)
-				vap->iv_newstate(vap, IEEE80211_S_INIT, 0);
 			return 0;
 		}
 	}

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 19:35:41 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48308106568B;
	Wed, 21 Oct 2009 19:35:41 +0000 (UTC)
	(envelope-from rdivacky@vlk.vlakno.cz)
Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190])
	by mx1.freebsd.org (Postfix) with ESMTP id F190D8FC08;
	Wed, 21 Oct 2009 19:35:39 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id 4A6859CB0E8;
	Wed, 21 Oct 2009 21:35:01 +0200 (CEST)
X-Virus-Scanned: amavisd-new at vlakno.cz
Received: from vlakno.cz ([127.0.0.1])
	by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id iT6cgdYS-fzK; Wed, 21 Oct 2009 21:34:59 +0200 (CEST)
Received: from vlk.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id 010389CB148;
	Wed, 21 Oct 2009 21:34:59 +0200 (CEST)
Received: (from rdivacky@localhost)
	by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n9LJYwSt014346;
	Wed, 21 Oct 2009 21:34:58 +0200 (CEST) (envelope-from rdivacky)
Date: Wed, 21 Oct 2009 21:34:58 +0200
From: Roman Divacky 
To: John Baldwin 
Message-ID: <20091021193458.GA14138@freebsd.org>
References: <200910211926.n9LJQDYF008372@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200910211926.n9LJQDYF008372@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198344 - head/contrib/gcc/config/i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 19:35:41 -0000

On Wed, Oct 21, 2009 at 07:26:13PM +0000, John Baldwin wrote:
> Author: jhb
> Date: Wed Oct 21 19:26:12 2009
> New Revision: 198344
> URL: http://svn.freebsd.org/changeset/base/198344
> 
> Log:
>   Change gcc to assume a default machine architecture of 486 instead of 386
>   on "i386".  Doing it in the compiler is deemed to be less fragile then
>   attempting to provide a default -march setting via bsd.cpu.mk.  FreeBSD
>   itself has not supported plain 386 CPUs since 5.x.

not only less fragile but not working for cross tools etc. which sets
NO_CPU_CFLAGS.

thank you John for this!

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 19:39:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 74A7810656A6;
	Wed, 21 Oct 2009 19:39:34 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 651FC8FC24;
	Wed, 21 Oct 2009 19:39:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LJdYZ5008722;
	Wed, 21 Oct 2009 19:39:34 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LJdYmZ008720;
	Wed, 21 Oct 2009 19:39:34 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200910211939.n9LJdYmZ008720@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Wed, 21 Oct 2009 19:39:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198347 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 19:39:34 -0000

Author: ru
Date: Wed Oct 21 19:39:34 2009
New Revision: 198347
URL: http://svn.freebsd.org/changeset/base/198347

Log:
  Move sed(1) from cross-tools to bootstrap-tools.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Wed Oct 21 19:31:23 2009	(r198346)
+++ head/Makefile.inc1	Wed Oct 21 19:39:34 2009	(r198347)
@@ -929,6 +929,10 @@ _ar=		usr.bin/ar
 _mklocale=	usr.bin/mklocale
 .endif
 
+.if ${BOOTSTRAPPING} < 900002
+_sed=		usr.bin/sed
+.endif
+
 .if ${BOOTSTRAPPING} < 700018
 _gensnmptree=	usr.sbin/bsnmpd/gensnmptree
 .endif
@@ -954,6 +958,7 @@ bootstrap-tools:
     usr.bin/makewhatis \
     ${_mklocale} \
     usr.bin/rpcgen \
+    ${_sed} \
     usr.bin/xinstall \
     ${_gensnmptree} \
     usr.sbin/config \
@@ -1033,7 +1038,6 @@ cross-tools:
 .for _tool in \
     gnu/usr.bin/binutils \
     gnu/usr.bin/cc \
-    usr.bin/sed \
     usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
     ${_btxld} \
     ${_crunchide} \

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 20:55:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 61513106566C;
	Wed, 21 Oct 2009 20:55:04 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4E0D88FC12;
	Wed, 21 Oct 2009 20:55:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LKt4UW010335;
	Wed, 21 Oct 2009 20:55:04 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LKt4Oi010332;
	Wed, 21 Oct 2009 20:55:04 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200910212055.n9LKt4Oi010332@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 21 Oct 2009 20:55:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198350 - head/usr.sbin/tzsetup
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 20:55:04 -0000

Author: edwin
Date: Wed Oct 21 20:55:04 2009
New Revision: 198350
URL: http://svn.freebsd.org/changeset/base/198350

Log:
  - Add support for chrooted installs.
  - Add examples to the man-page.
  
  MFC after:	1 week

Modified:
  head/usr.sbin/tzsetup/tzsetup.8
  head/usr.sbin/tzsetup/tzsetup.c

Modified: head/usr.sbin/tzsetup/tzsetup.8
==============================================================================
--- head/usr.sbin/tzsetup/tzsetup.8	Wed Oct 21 20:33:50 2009	(r198349)
+++ head/usr.sbin/tzsetup/tzsetup.8	Wed Oct 21 20:55:04 2009	(r198350)
@@ -32,7 +32,8 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl nrs
-.Op Ar zoneinfo file
+.Op Fl C Ar chroot directory
+.Op Ar zoneinfo file | zoneinfo name
 .Sh DESCRIPTION
 The
 .Nm
@@ -49,6 +50,9 @@ the hardware clock does not keep
 .Pp
 The following option is available:
 .Bl -tag -offset indent -width Fl
+.It Fl C Ar chroot directory
+Open all files and directories relative to
+.Ar chroot directory .
 .It Fl n
 Do not create or copy files.
 .It Fl r
@@ -62,8 +66,10 @@ Skip the initial question about adjustin
 It is possible to short-circuit the menu system by specifying the
 location of a
 .Ar zoneinfo file
+or the name of the
+.Ar zoneinfo name
 on the command line; this is intended mainly for pre-configured installation
-scripts.
+scripts or people who know which zoneinfo they want to install.
 .Sh TIMEZONE DATABASE
 The contents of the timezone database are indexed by
 .Pa /usr/share/zoneinfo/zone.tab .
@@ -97,21 +103,36 @@ historically minded.
 .Sh FILES
 .Bl -tag -width /usr/share/zoneinfo/zone.tab -compact
 .It Pa /etc/localtime
-current time zone file
+current time zone file.
 .It Pa /etc/wall_cmos_clock
 see
 .Xr adjkerntz 8 .
 .It Pa /usr/share/misc/iso3166
 mapping of
 .Tn ISO
-3166 territory codes to names
+3166 territory codes to names.
 .It Pa /usr/share/zoneinfo
-directory for zoneinfo files
+directory for zoneinfo files.
 .It Pa /usr/share/zoneinfo/zone.tab
-mapping of timezone file to country and location
+mapping of timezone file to country and location.
 .It Pa /var/db/zoneinfo
 saved name of the timezone file installed last.
 .El
+.Sh EXAMPLES
+Normal usage, to select the right zoneinfo file via the dialog-based
+user interface:
+.Dl # tzsetup
+Install the file
+.Pa /usr/share/zoneinfo/Australia/Sydney :
+.Dl # tzsetup /usr/share/zoneinfo/Australia/Sydney
+Install the zoneinfo file for Australia/Sydney, assumed to be located
+in
+.Pa /usr/share/zoneinfo :
+.Dl # tzsetup Australia/Sydney
+After a reinstall of the zoneinfo files, you can reinstall the
+latest installed zoneinfo file: (as specified in
+.Pa /var/db/zoneinfo )
+.Dl # tzsetup -r
 .Sh SEE ALSO
 .Xr date 1 ,
 .Xr adjtime 2 ,

Modified: head/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- head/usr.sbin/tzsetup/tzsetup.c	Wed Oct 21 20:33:50 2009	(r198349)
+++ head/usr.sbin/tzsetup/tzsetup.c	Wed Oct 21 20:55:04 2009	(r198350)
@@ -56,8 +56,14 @@ __FBSDID("$FreeBSD$");
 #define	_PATH_DB		"/var/db/zoneinfo"
 #define	_PATH_WALL_CMOS_CLOCK	"/etc/wall_cmos_clock"
 
+static char	path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN],
+		path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], 
+		path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN];
+
 static int reallydoit = 1;
 static int reinstall = 0;
+static int usedialog = 1;
+static char *chrootenv = NULL;
 
 static void	usage(void);
 static int	continent_country_menu(dialogMenuItem *);
@@ -196,15 +202,15 @@ read_iso3166_table(void)
 	char		*s, *t, *name;
 	int		lineno;
 
-	fp = fopen(_PATH_ISO3166, "r");
+	fp = fopen(path_iso3166, "r");
 	if (!fp)
-		err(1, _PATH_ISO3166);
+		err(1, path_iso3166);
 	lineno = 0;
 
 	while ((s = fgetln(fp, &len)) != 0) {
 		lineno++;
 		if (s[len - 1] != '\n')
-			errx(1, _PATH_ISO3166 ":%d: invalid format", lineno);
+			errx(1, "%s:%d: invalid format", path_iso3166, lineno);
 		s[len - 1] = '\0';
 		if (s[0] == '#' || strspn(s, " \t") == len - 1)
 			continue;
@@ -212,26 +218,25 @@ read_iso3166_table(void)
 		/* Isolate the two-letter code. */
 		t = strsep(&s, "\t");
 		if (t == 0 || strlen(t) != 2)
-			errx(1, _PATH_ISO3166 ":%d: invalid format", lineno);
+			errx(1, "%s:%d: invalid format", path_iso3166, lineno);
 		if (t[0] < 'A' || t[0] > 'Z' || t[1] < 'A' || t[1] > 'Z')
-			errx(1, _PATH_ISO3166 ":%d: invalid code `%s'",
+			errx(1, "%s:%d: invalid code `%s'", path_iso3166,
 			    lineno, t);
 
 		/* Now skip past the three-letter and numeric codes. */
 		name = strsep(&s, "\t");	/* 3-let */
 		if (name == 0 || strlen(name) != 3)
-			errx(1, _PATH_ISO3166 ":%d: invalid format", lineno);
+			errx(1, "%s:%d: invalid format", path_iso3166, lineno);
 		name = strsep(&s, "\t");	/* numeric */
 		if (name == 0 || strlen(name) != 3)
-			errx(1, _PATH_ISO3166 ":%d: invalid format", lineno);
+			errx(1, "%s:%d: invalid format", path_iso3166, lineno);
 
 		name = s;
 
 		cp = &countries[CODE2INT(t)];
 		if (cp->name)
-			errx(1, _PATH_ISO3166
-			    ":%d: country code `%s' multiply defined: %s",
-			    lineno, t, cp->name);
+			errx(1, "%s:%d: country code `%s' multiply defined: %s",
+			    path_iso3166, lineno, t, cp->name);
 		cp->name = strdup(name);
 		if (cp->name == NULL)
 			errx(1, "malloc failed");
@@ -251,18 +256,18 @@ add_zone_to_country(int lineno, const ch
 	struct country	*cp;
 
 	if (tlc[0] < 'A' || tlc[0] > 'Z' || tlc[1] < 'A' || tlc[1] > 'Z')
-		errx(1, _PATH_ZONETAB ":%d: country code `%s' invalid",
+		errx(1, "%s:%d: country code `%s' invalid", path_zonetab,
 		    lineno, tlc);
 	
 	cp = &countries[CODE2INT(tlc)];
 	if (cp->name == 0)
-		errx(1, _PATH_ZONETAB ":%d: country code `%s' unknown",
+		errx(1, "%s:%d: country code `%s' unknown", path_zonetab,
 		    lineno, tlc);
 
 	if (descr) {
 		if (cp->nzones < 0)
-			errx(1, _PATH_ZONETAB
-			    ":%d: conflicting zone definition", lineno);
+			errx(1, "%s:%d: conflicting zone definition",
+			    path_zonetab, lineno);
 
 		zp = malloc(sizeof(*zp));
 		if (zp == 0)
@@ -282,11 +287,11 @@ add_zone_to_country(int lineno, const ch
 		cp->nzones++;
 	} else {
 		if (cp->nzones > 0)
-			errx(1, _PATH_ZONETAB
-			    ":%d: zone must have description", lineno);
+			errx(1, "%s:%d: zone must have description",
+			    path_zonetab, lineno);
 		if (cp->nzones < 0)
-			errx(1, _PATH_ZONETAB
-			    ":%d: zone multiply defined", lineno);
+			errx(1, "%s:%d: zone multiply defined",
+			    path_zonetab, lineno);
 		cp->nzones = -1;
 		cp->filename = strdup(file);
 		if (cp->filename == NULL)
@@ -336,34 +341,34 @@ read_zones(void)
 	char		*line, *tlc, *coord, *file, *descr, *p;
 	int		lineno;
 
-	fp = fopen(_PATH_ZONETAB, "r");
+	fp = fopen(path_zonetab, "r");
 	if (!fp)
-		err(1, _PATH_ZONETAB);
+		err(1, path_zonetab);
 	lineno = 0;
 
 	while ((line = fgetln(fp, &len)) != 0) {
 		lineno++;
 		if (line[len - 1] != '\n')
-			errx(1, _PATH_ZONETAB ":%d: invalid format", lineno);
+			errx(1, "%s:%d: invalid format", path_zonetab, lineno);
 		line[len - 1] = '\0';
 		if (line[0] == '#')
 			continue;
 
 		tlc = strsep(&line, "\t");
 		if (strlen(tlc) != 2)
-			errx(1, _PATH_ZONETAB ":%d: invalid country code `%s'",
-			    lineno, tlc);
+			errx(1, "%s:%d: invalid country code `%s'",
+			    path_zonetab, lineno, tlc);
 		coord = strsep(&line, "\t");
 		file = strsep(&line, "\t");
 		p = strchr(file, '/');
 		if (p == 0)
-			errx(1, _PATH_ZONETAB ":%d: invalid zone name `%s'",
+			errx(1, "%s:%d: invalid zone name `%s'", path_zonetab,
 			    lineno, file);
 		contbuf[0] = '\0';
 		strncat(contbuf, file, p - file);
 		cont = find_continent(contbuf);
 		if (!cont)
-			errx(1, _PATH_ZONETAB ":%d: invalid region `%s'",
+			errx(1, "%s:%d: invalid region `%s'", path_zonetab,
 			    lineno, contbuf);
 
 		descr = (line != NULL && *line != '\0') ? line : NULL;
@@ -498,16 +503,15 @@ set_zone_menu(dialogMenuItem *dmi)
 }
 
 static int
-install_zone_file(const char *filename, int usedialog)
+install_zoneinfo_file(const char *zoneinfo_file)
 {
 	char		buf[1024];
 	char		title[64], prompt[64];
 	struct stat	sb;
 	ssize_t		len;
 	int		fd1, fd2, copymode;
-	FILE		*f;
 
-	if (lstat(_PATH_LOCALTIME, &sb) < 0) {
+	if (lstat(path_localtime, &sb) < 0) {
 		/* Nothing there yet... */
 		copymode = 1;
 	} else if (S_ISLNK(sb.st_mode))
@@ -518,11 +522,11 @@ install_zone_file(const char *filename, 
 #ifdef VERBOSE
 	if (copymode)
 		snprintf(prompt, sizeof(prompt),
-		    "Copying %s to " _PATH_LOCALTIME, filename);
+		    "Copying %s to %s", zoneinfo_file, path_localtime);
 	else
 		snprintf(prompt, sizeof(prompt),
-		    "Creating symbolic link " _PATH_LOCALTIME " to %s",
-		    filename);
+		    "Creating symbolic link %s to %s",
+		    path_localtime, zoneinfo_file);
 	if (usedialog)
 		dialog_notify(prompt);
 	else
@@ -531,11 +535,11 @@ install_zone_file(const char *filename, 
 
 	if (reallydoit) {
 		if (copymode) {
-			fd1 = open(filename, O_RDONLY, 0);
+			fd1 = open(zoneinfo_file, O_RDONLY, 0);
 			if (fd1 < 0) {
 				snprintf(title, sizeof(title), "Error");
 				snprintf(prompt, sizeof(prompt),
-				    "Could not open %s: %s", filename,
+				    "Could not open %s: %s", zoneinfo_file,
 				    strerror(errno));
 				if (usedialog)
 					dialog_mesgbox(title, prompt, 8, 72);
@@ -544,14 +548,14 @@ install_zone_file(const char *filename, 
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
 
-			unlink(_PATH_LOCALTIME);
-			fd2 = open(_PATH_LOCALTIME, O_CREAT | O_EXCL | O_WRONLY,
+			unlink(path_localtime);
+			fd2 = open(path_localtime, O_CREAT | O_EXCL | O_WRONLY,
 			    S_IRUSR | S_IRGRP | S_IROTH);
 			if (fd2 < 0) {
 				snprintf(title, sizeof(title), "Error");
 				snprintf(prompt, sizeof(prompt),
-				    "Could not open " _PATH_LOCALTIME ": %s",
-				    strerror(errno));
+				    "Could not open %s: %s",
+				    path_localtime, strerror(errno));
 				if (usedialog)
 					dialog_mesgbox(title, prompt, 8, 72);
 				else
@@ -565,23 +569,23 @@ install_zone_file(const char *filename, 
 			if (len == -1) {
 				snprintf(title, sizeof(title), "Error");
 				snprintf(prompt, sizeof(prompt),
-				    "Error copying %s to " _PATH_LOCALTIME
-				    ": %s", filename, strerror(errno));
+				    "Error copying %s to %s %s", zoneinfo_file,
+				    path_localtime, strerror(errno));
 				if (usedialog)
 					dialog_mesgbox(title, prompt, 8, 72);
 				else
 					fprintf(stderr, "%s\n", prompt);
 				/* Better to leave none than a corrupt one. */
-				unlink(_PATH_LOCALTIME);
+				unlink(path_localtime);
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
 			close(fd1);
 			close(fd2);
 		} else {
-			if (access(filename, R_OK) != 0) {
+			if (access(zoneinfo_file, R_OK) != 0) {
 				snprintf(title, sizeof(title), "Error");
 				snprintf(prompt, sizeof(prompt),
-				    "Cannot access %s: %s", filename,
+				    "Cannot access %s: %s", zoneinfo_file,
 				    strerror(errno));
 				if (usedialog)
 					dialog_mesgbox(title, prompt, 8, 72);
@@ -589,12 +593,12 @@ install_zone_file(const char *filename, 
 					fprintf(stderr, "%s\n", prompt);
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
-			unlink(_PATH_LOCALTIME);
-			if (symlink(filename, _PATH_LOCALTIME) < 0) {
+			unlink(path_localtime);
+			if (symlink(zoneinfo_file, path_localtime) < 0) {
 				snprintf(title, sizeof(title), "Error");
 				snprintf(prompt, sizeof(prompt),
-				    "Cannot create symbolic link "
-				    _PATH_LOCALTIME " to %s: %s", filename,
+				    "Cannot create symbolic link %s to %s: %s",
+				    path_localtime, zoneinfo_file,
 				    strerror(errno));
 				if (usedialog)
 					dialog_mesgbox(title, prompt, 8, 72);
@@ -609,24 +613,38 @@ install_zone_file(const char *filename, 
 	snprintf(title, sizeof(title), "Done");
 	if (copymode)
 		snprintf(prompt, sizeof(prompt),
-		    "Copied timezone file from %s to " _PATH_LOCALTIME,
-		    filename);
+		    "Copied timezone file from %s to %s", zoneinfo_file,
+		    path_localtime);
 	else
-		snprintf(prompt, sizeof(prompt), "Created symbolic link from "
-		    _PATH_LOCALTIME " to %s", filename);
+		snprintf(prompt, sizeof(prompt),
+		    "Created symbolic link from %s to %s", zoneinfo_file,
+		    path_localtime);
 	if (usedialog)
 		dialog_mesgbox(title, prompt, 8, 72);
 	else
 		fprintf(stderr, "%s\n", prompt);
 #endif
 
+	return (DITEM_LEAVE_MENU);
+}
+
+static int
+install_zoneinfo(const char *zoneinfo)
+{
+	int		rv;
+	FILE		*f;
+	char		path_zoneinfo_file[MAXPATHLEN];
+
+	sprintf(path_zoneinfo_file, "%s/%s", path_zoneinfo, zoneinfo);
+	rv = install_zoneinfo_file(path_zoneinfo_file);
+
 	/* Save knowledge for later */
-	if ((f = fopen(_PATH_DB, "w")) != NULL) {
-		fprintf(f, "%s\n", filename + strlen(_PATH_ZONEINFO) + 1);
+	if ((f = fopen(path_db, "w")) != NULL) {
+		fprintf(f, "%s\n", zoneinfo);
 		fclose(f);
 	}
 
-	return (DITEM_LEAVE_MENU);
+	return (rv);
 }
 
 static int
@@ -652,15 +670,12 @@ static int
 set_zone_multi(dialogMenuItem *dmi)
 {
 	struct zone	*zp = dmi->data;
-	char		*fn;
 	int		rv;
 
 	if (!confirm_zone(zp->filename))
 		return (DITEM_FAILURE | DITEM_RECREATE);
 
-	asprintf(&fn, "%s/%s", _PATH_ZONEINFO, zp->filename);
-	rv = install_zone_file(fn, 1);
-	free(fn);
+	rv = install_zoneinfo(zp->filename);
 	return (rv);
 }
 
@@ -668,15 +683,12 @@ static int
 set_zone_whole_country(dialogMenuItem *dmi)
 {
 	struct country	*cp = dmi->data;
-	char		*fn;
 	int		rv;
 
 	if (!confirm_zone(cp->filename))
 		return (DITEM_FAILURE | DITEM_RECREATE);
 
-	asprintf(&fn, "%s/%s", _PATH_ZONEINFO, cp->filename);
-	rv = install_zone_file(fn, 1);
-	free(fn);
+	rv = install_zoneinfo(cp->filename);
 	return (rv);
 }
 
@@ -701,13 +713,17 @@ main(int argc, char **argv)
 	int		c, fd, rv, skiputc;
 
 	skiputc = 0;
-	while ((c = getopt(argc, argv, "nrs")) != -1) {
+	while ((c = getopt(argc, argv, "C:nrs")) != -1) {
 		switch(c) {
+		case 'C':
+			chrootenv = optarg;
+			break;
 		case 'n':
 			reallydoit = 0;
 			break;
 		case 'r':
 			reinstall = 1;
+			usedialog = 0;
 			break;
 		case 's':
 			skiputc = 1;
@@ -720,6 +736,24 @@ main(int argc, char **argv)
 	if (argc - optind > 1)
 		usage();
 
+	if (chrootenv == NULL) {
+		strcpy(path_zonetab, _PATH_ZONETAB);
+		strcpy(path_iso3166, _PATH_ISO3166);
+		strcpy(path_zoneinfo, _PATH_ZONEINFO);
+		strcpy(path_localtime, _PATH_LOCALTIME);
+		strcpy(path_db, _PATH_DB);
+		strcpy(path_wall_cmos_clock, _PATH_WALL_CMOS_CLOCK);
+	} else {
+		sprintf(path_zonetab, "%s/%s", chrootenv, _PATH_ZONETAB);
+		sprintf(path_iso3166, "%s/%s", chrootenv, _PATH_ISO3166);
+		sprintf(path_zoneinfo, "%s/%s", chrootenv, _PATH_ZONEINFO);
+		sprintf(path_localtime, "%s/%s", chrootenv, _PATH_LOCALTIME);
+		sprintf(path_db, "%s/%s", chrootenv, _PATH_DB);
+		sprintf(path_wall_cmos_clock, "%s/%s", chrootenv,
+		    _PATH_WALL_CMOS_CLOCK);
+	}
+
+
 	/* Override the user-supplied umask. */
 	(void)umask(S_IWGRP | S_IWOTH);
 
@@ -731,25 +765,49 @@ main(int argc, char **argv)
 	if (reinstall == 1) {
 		FILE *f;
 		char zonefile[MAXPATHLEN];
+		char path_db[MAXPATHLEN];
+
+		zonefile[0] = '\0';
+		path_db[0] = '\0';
+		if (chrootenv != NULL) {
+			sprintf(zonefile, "%s/", chrootenv);
+			sprintf(path_db, "%s/", chrootenv);
+		}
+		strcat(zonefile, _PATH_ZONEINFO);
+		strcat(zonefile, "/");
+		strcat(path_db, _PATH_DB);
 
-		sprintf(zonefile, "%s/", _PATH_ZONEINFO);
-		if ((f = fopen(_PATH_DB, "r")) != NULL) {
-			if (fgets(zonefile + strlen(zonefile),
-			    sizeof(zonefile) - strlen(zonefile), f) != NULL) {
+		if ((f = fopen(path_db, "r")) != NULL) {
+			if (fgets(zonefile, sizeof(zonefile), f) != NULL) {
 				zonefile[sizeof(zonefile) - 1] = 0;
 				if (strlen(zonefile) > 0) {
 					zonefile[strlen(zonefile) - 1] = 0;
-					rv = install_zone_file(zonefile, 0);
+					rv = install_zoneinfo(zonefile);
 					exit(rv & ~DITEM_LEAVE_MENU);
 				}
-				errx(1, "Error reading %s.\n", _PATH_DB);
+				errx(1, "Error reading %s.\n", path_db);
 			}
 			fclose(f);
 			errx(1,
 			    "Unable to determine earlier installed zoneinfo "
-			    "file. Check %s", _PATH_DB);
+			    "file. Check %s", path_db);
+		}
+		errx(1, "Cannot open %s for reading. Does it exist?", path_db);
+	}
+
+	/*
+	 * If the arguments on the command-line do not specify a file,
+	 * then interpret it as a zoneinfo name
+	 */
+	if (optind == argc - 1) {
+		struct stat sb;
+
+		if (stat(argv[optind], &sb) != 0) {
+			usedialog = 0;
+			rv = install_zoneinfo(argv[optind]);
+			exit(rv & ~DITEM_LEAVE_MENU);
 		}
-		errx(1, "Cannot open %s for reading. Does it exist?", _PATH_DB);
+		/* FALLTHROUGH */
 	}
 
 	init_dialog();
@@ -783,7 +841,7 @@ main(int argc, char **argv)
 		snprintf(prompt, sizeof(prompt),
 		    "\nUse the default `%s' zone?", argv[optind]);
 		if (!dialog_yesno(title, prompt, 7, 72)) {
-			rv = install_zone_file(argv[optind], 1);
+			rv = install_zoneinfo_file(argv[optind]);
 			dialog_clear();
 			end_dialog();
 			exit(rv & ~DITEM_LEAVE_MENU);

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 20:59:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CB2C1065693;
	Wed, 21 Oct 2009 20:59:13 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C9A58FC26;
	Wed, 21 Oct 2009 20:59:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LKxDCL010449;
	Wed, 21 Oct 2009 20:59:13 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LKxDDQ010447;
	Wed, 21 Oct 2009 20:59:13 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200910212059.n9LKxDDQ010447@svn.freebsd.org>
From: Edwin Groothuis 
Date: Wed, 21 Oct 2009 20:59:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198351 - head/share/zoneinfo
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 20:59:13 -0000

Author: edwin
Date: Wed Oct 21 20:59:12 2009
New Revision: 198351
URL: http://svn.freebsd.org/changeset/base/198351

Log:
  After the installation of the /usr/share/zoneinfo, run tzsetup if
  /var/db/zoneinfo exists.
  
  MFC after:	1 week

Modified:
  head/share/zoneinfo/Makefile

Modified: head/share/zoneinfo/Makefile
==============================================================================
--- head/share/zoneinfo/Makefile	Wed Oct 21 20:55:04 2009	(r198350)
+++ head/share/zoneinfo/Makefile	Wed Oct 21 20:59:12 2009	(r198351)
@@ -54,4 +54,24 @@ beforeinstall:
 	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
 	    ${.CURDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
 
+afterinstall:
+	@#
+	@# If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
+	@# and the contents of it exists in /usr/share/zoneinfo, then reinstall
+	@# it.
+	@#
+	@if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
+	    -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
+		zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
+		if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
+			if [ ! -z "${DESTDIR}" ]; then \
+				optC="-C ${DESTDIR}"; \
+			fi; \
+			echo "Updating /etc/localtime"; \
+			tzsetup ${optC} -r; \
+		fi; \
+	else \
+		echo "Run tzsetup(8) manually to update /etc/localtime."; \
+	fi
+
 .include 

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 21:07:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 53F3C106566B;
	Wed, 21 Oct 2009 21:07:13 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from mail.vega.ru (mail.vega.ru [90.156.167.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 0FF478FC1A;
	Wed, 21 Oct 2009 21:07:12 +0000 (UTC)
Received: from [10.100.124.99] (port=53814 helo=edoofus.dev.vega.ru)
	by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1N0iOl-000FI5-Or; Thu, 22 Oct 2009 01:07:11 +0400
Date: Thu, 22 Oct 2009 01:07:07 +0400
From: Ruslan Ermilov 
To: Roman Divacky 
Message-ID: <20091021210707.GB5410@edoofus.dev.vega.ru>
References: <200910211707.n9LH7kHx005204@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200910211707.n9LH7kHx005204@svn.freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198335 - head/share/mk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 21:07:13 -0000

On Wed, Oct 21, 2009 at 05:07:46PM +0000, Roman Divacky wrote:
> Author: rdivacky
> Date: Wed Oct 21 17:07:46 2009
> New Revision: 198335
> URL: http://svn.freebsd.org/changeset/base/198335
> 
> Log:
>   Set CSTD in all cases except when CC=icc and NO_WARNS is set. This
>   way we can set desired C standard even for cross tools etc.
>   
I think you meant to say "always set CFLAGS based on CSTD".
Unfortunately the actual change does not only that, it also
breaks NO_WARNS (by ignoring it) for anything that's not "icc".
It also breaks "icc" compiles without NO_WARNS by passing
unrecognized flags to the compiler.  A correct change would
be to move setting of CFLAGS based on CSTD out of the control
of NO_WARNS, like this:

%%%
Index: bsd.sys.mk
===================================================================
--- bsd.sys.mk	(revision 198170)
+++ bsd.sys.mk	(working copy)
@@ -11,7 +11,7 @@
 # the default is gnu99 for now
 CSTD		?= gnu99
 
-.if !defined(NO_WARNS) && ${CC} != "icc"
+.if ${CC} != "icc"
 . if ${CSTD} == "k&r"
 CFLAGS		+= -traditional
 . elif ${CSTD} == "c89" || ${CSTD} == "c90"
@@ -23,6 +23,8 @@
 . else
 CFLAGS		+= -std=${CSTD}
 . endif
+.endif
+.if !defined(NO_WARNS) && ${CC} != "icc"
 # -pedantic is problematic because it also imposes namespace restrictions
 #CFLAGS		+= -pedantic
 . if defined(WARNS)
%%%

>   Tested by:	make universe
>   Approved by:	ed (maintainer)
>   OK by:		das
> 
> Modified:
>   head/share/mk/bsd.sys.mk
> 
> Modified: head/share/mk/bsd.sys.mk
> ==============================================================================
> --- head/share/mk/bsd.sys.mk	Wed Oct 21 16:12:09 2009	(r198334)
> +++ head/share/mk/bsd.sys.mk	Wed Oct 21 17:07:46 2009	(r198335)
> @@ -11,7 +11,7 @@
>  # the default is gnu99 for now
>  CSTD		?= gnu99
>  
> -.if !defined(NO_WARNS) && ${CC} != "icc"
> +.if !defined(NO_WARNS) || ${CC} != "icc"
>  . if ${CSTD} == "k&r"
>  CFLAGS		+= -traditional
>  . elif ${CSTD} == "c89" || ${CSTD} == "c90"
> 

-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

From owner-svn-src-head@FreeBSD.ORG  Wed Oct 21 23:50:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DDF53106566C;
	Wed, 21 Oct 2009 23:50:35 +0000 (UTC)
	(envelope-from philip@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC38C8FC12;
	Wed, 21 Oct 2009 23:50:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9LNoZ2O013747;
	Wed, 21 Oct 2009 23:50:35 GMT (envelope-from philip@svn.freebsd.org)
Received: (from philip@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9LNoZ79013743;
	Wed, 21 Oct 2009 23:50:35 GMT (envelope-from philip@svn.freebsd.org)
Message-Id: <200910212350.n9LNoZ79013743@svn.freebsd.org>
From: Philip Paeps 
Date: Wed, 21 Oct 2009 23:50:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198352 - head/sbin/dhclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 21 Oct 2009 23:50:36 -0000

Author: philip
Date: Wed Oct 21 23:50:35 2009
New Revision: 198352
URL: http://svn.freebsd.org/changeset/base/198352

Log:
  Make dhclient use bootpc (68) as the source port for unicast DHCPREQUEST
  packets instead of allowing the protocol stack to pick a random source port.
  
  This fixes the behaviour where dhclient would never transition from RENEWING
  to BOUND without going through REBINDING in networks which are paranoid about
  DHCP spoofing, such as most mainstream cable-broadband ISP networks.
  
  Reviewed by:	brooks
  Obtained from:	OpenBSD (partly - I'm not convinced their solution can work)
  MFC after:	1 week (pending re approval)

Modified:
  head/sbin/dhclient/bpf.c
  head/sbin/dhclient/dhcpd.h
  head/sbin/dhclient/packet.c

Modified: head/sbin/dhclient/bpf.c
==============================================================================
--- head/sbin/dhclient/bpf.c	Wed Oct 21 20:59:12 2009	(r198351)
+++ head/sbin/dhclient/bpf.c	Wed Oct 21 23:50:35 2009	(r198352)
@@ -90,11 +90,23 @@ if_register_bpf(struct interface_info *i
 void
 if_register_send(struct interface_info *info)
 {
+	int sock, on = 1;
+
 	/*
 	 * If we're using the bpf API for sending and receiving, we
 	 * don't need to register this interface twice.
 	 */
 	info->wfdesc = info->rfdesc;
+
+	/*
+	 * Use raw socket for unicast send.
+	 */
+	if ((sock = socket(AF_INET, SOCK_RAW, IPPROTO_UDP)) == -1)
+		error("socket(SOCK_RAW): %m");
+	if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, &on,
+	    sizeof(on)) == -1)
+		error("setsockopt(IP_HDRINCL): %m");
+	info->ufdesc = sock;
 }
 
 /*
@@ -244,35 +256,32 @@ send_packet(struct interface_info *inter
 {
 	unsigned char buf[256];
 	struct iovec iov[2];
+	struct msghdr msg;
 	int result, bufp = 0;
-	int sock;
-
-	if (to->sin_addr.s_addr != INADDR_BROADCAST) {
-		note("SENDING DIRECT");
-		/* We know who the server is, send the packet via
-		   normal socket interface */
-
-		if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) >= 0) {
-			result = sendto (sock, (char *)raw, len, 0,
-					 (struct sockaddr *)to, sizeof *to);
-			close(sock);
-			if (result > 0)
-				return result;
-			}
-		}
 
 	/* Assemble the headers... */
-	assemble_hw_header(interface, buf, &bufp, hto);
+	if (to->sin_addr.s_addr == INADDR_BROADCAST)
+		assemble_hw_header(interface, buf, &bufp, hto);
 	assemble_udp_ip_header(buf, &bufp, from.s_addr,
 	    to->sin_addr.s_addr, to->sin_port, (unsigned char *)raw, len);
 
-	/* Fire it off */
 	iov[0].iov_base = (char *)buf;
 	iov[0].iov_len = bufp;
 	iov[1].iov_base = (char *)raw;
 	iov[1].iov_len = len;
 
-	result = writev(interface->wfdesc, iov, 2);
+	/* Fire it off */
+	if (to->sin_addr.s_addr == INADDR_BROADCAST)
+		result = writev(interface->wfdesc, iov, 2);
+	else {
+		memset(&msg, 0, sizeof(msg));
+		msg.msg_name = (struct sockaddr *)to;
+		msg.msg_namelen = sizeof(*to);
+		msg.msg_iov = iov;
+		msg.msg_iovlen = 2;
+		result = sendmsg(interface->ufdesc, &msg, 0);
+	}
+
 	if (result < 0)
 		warning("send_packet: %m");
 	return (result);

Modified: head/sbin/dhclient/dhcpd.h
==============================================================================
--- head/sbin/dhclient/dhcpd.h	Wed Oct 21 20:59:12 2009	(r198351)
+++ head/sbin/dhclient/dhcpd.h	Wed Oct 21 23:50:35 2009	(r198352)
@@ -37,6 +37,8 @@
  * Enterprises.  To learn more about the Internet Software Consortium,
  * see ``http://www.vix.com/isc''.  To learn more about Vixie
  * Enterprises, see ``http://www.vix.com''.
+ *
+ * $FreeBSD$
  */
 
 #include 
@@ -194,6 +196,7 @@ struct interface_info {
 	char			 name[IFNAMSIZ];
 	int			 rfdesc;
 	int			 wfdesc;
+	int			 ufdesc;
 	unsigned char		*rbuf;
 	size_t			 rbuf_max;
 	size_t			 rbuf_offset;

Modified: head/sbin/dhclient/packet.c
==============================================================================
--- head/sbin/dhclient/packet.c	Wed Oct 21 20:59:12 2009	(r198351)
+++ head/sbin/dhclient/packet.c	Wed Oct 21 23:50:35 2009	(r198352)
@@ -135,6 +135,17 @@ assemble_udp_ip_header(unsigned char *bu
 	ip.ip_dst.s_addr = to;
 
 	ip.ip_sum = wrapsum(checksum((unsigned char *)&ip, sizeof(ip), 0));
+
+	/*
+	 * While the BPF -- used for broadcasts -- expects a "true" IP header
+	 * with all the bytes in network byte order, the raw socket interface
+	 * which is used for unicasts expects the ip_len field to be in host
+	 * byte order.  In both cases, the checksum has to be correct, so this
+	 * is as good a place as any to turn the bytes around again.
+	 */
+	if (to != INADDR_BROADCAST)
+		ip.ip_len = ntohs(ip.ip_len);
+
 	memcpy(&buf[*bufix], &ip, sizeof(ip));
 	*bufix += sizeof(ip);
 

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 00:32:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BEE9F106566B;
	Thu, 22 Oct 2009 00:32:01 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ADCFB8FC0A;
	Thu, 22 Oct 2009 00:32:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9M0W1Xb014548;
	Thu, 22 Oct 2009 00:32:01 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9M0W1pV014546;
	Thu, 22 Oct 2009 00:32:01 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <200910220032.n9M0W1pV014546@svn.freebsd.org>
From: Qing Li 
Date: Thu, 22 Oct 2009 00:32:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198353 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 00:32:01 -0000

Author: qingli
Date: Thu Oct 22 00:32:01 2009
New Revision: 198353
URL: http://svn.freebsd.org/changeset/base/198353

Log:
  Verify "smp_started" is true before calling
  sched_bind() and sched_unbind().
  
  Reviewed by:	kmacy
  MFC after:	3 days

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Wed Oct 21 23:50:35 2009	(r198352)
+++ head/sys/net/flowtable.c	Thu Oct 22 00:32:01 2009	(r198353)
@@ -963,15 +963,19 @@ flowtable_clean_vnet(void)
 				if (CPU_ABSENT(i))
 					continue;
 
-				thread_lock(curthread);
-				sched_bind(curthread, i);
-				thread_unlock(curthread);
+				if (smp_started == 1) {
+					thread_lock(curthread);
+					sched_bind(curthread, i);
+					thread_unlock(curthread);
+				}
 
 				flowtable_free_stale(ft, NULL);
 
-				thread_lock(curthread);
-				sched_unbind(curthread);
-				thread_unlock(curthread);
+				if (smp_started == 1) {
+					thread_lock(curthread);
+					sched_unbind(curthread);
+					thread_unlock(curthread);
+				}
 			}
 		} else {
 			flowtable_free_stale(ft, NULL);

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 06:13:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4EC751065672;
	Thu, 22 Oct 2009 06:13:08 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DC118FC24;
	Thu, 22 Oct 2009 06:13:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9M6D7ZC020886;
	Thu, 22 Oct 2009 06:13:07 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9M6D7LK020884;
	Thu, 22 Oct 2009 06:13:07 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910220613.n9M6D7LK020884@svn.freebsd.org>
From: Christian Brueffer 
Date: Thu, 22 Oct 2009 06:13:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198356 - head/sys/cam/scsi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 06:13:08 -0000

Author: brueffer
Date: Thu Oct 22 06:13:07 2009
New Revision: 198356
URL: http://svn.freebsd.org/changeset/base/198356

Log:
  Fix a memory leak in an error case.
  
  PR:		138376
  Submitted by:	Patroklos Argyroudis 
  Reviewed by:	scottl
  MFC after:	1 week

Modified:
  head/sys/cam/scsi/scsi_low.c

Modified: head/sys/cam/scsi/scsi_low.c
==============================================================================
--- head/sys/cam/scsi/scsi_low.c	Thu Oct 22 04:35:32 2009	(r198355)
+++ head/sys/cam/scsi/scsi_low.c	Thu Oct 22 06:13:07 2009	(r198356)
@@ -638,7 +638,10 @@ scsi_low_attach_xs(slp)
 		return ENOMEM;
 	splp = SCSI_LOW_MALLOC(sizeof(*splp));
 	if (splp == NULL)
+	{
+		SCSI_LOW_FREE(sap);
 		return ENOMEM;
+	}
 
 	SCSI_LOW_BZERO(sap, sizeof(*sap));
 	SCSI_LOW_BZERO(splp, sizeof(*splp));

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 06:17:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D04BB106566B;
	Thu, 22 Oct 2009 06:17:04 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BFA158FC17;
	Thu, 22 Oct 2009 06:17:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9M6H4eZ020988;
	Thu, 22 Oct 2009 06:17:04 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9M6H4Tk020986;
	Thu, 22 Oct 2009 06:17:04 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910220617.n9M6H4Tk020986@svn.freebsd.org>
From: Christian Brueffer 
Date: Thu, 22 Oct 2009 06:17:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198357 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 06:17:04 -0000

Author: brueffer
Date: Thu Oct 22 06:17:04 2009
New Revision: 198357
URL: http://svn.freebsd.org/changeset/base/198357

Log:
  Check pointer for NULL before dereferencing it, not after.
  
  PR:		138390
  Submitted by:	Patroklos Argyroudis 
  MFC after:	1 week

Modified:
  head/sys/net/if_gif.c

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Thu Oct 22 06:13:07 2009	(r198356)
+++ head/sys/net/if_gif.c	Thu Oct 22 06:17:04 2009	(r198357)
@@ -507,7 +507,7 @@ gif_input(m, af, ifp)
 	struct ifnet *ifp;
 {
 	int isr, n;
-	struct gif_softc *sc = ifp->if_softc;
+	struct gif_softc *sc;
 	struct etherip_header *eip;
 	struct ether_header *eh;
 	struct ifnet *oldifp;
@@ -517,7 +517,7 @@ gif_input(m, af, ifp)
 		m_freem(m);
 		return;
 	}
-
+	sc = ifp->if_softc;
 	m->m_pkthdr.rcvif = ifp;
 
 #ifdef MAC

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 06:51:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0DB91106566B;
	Thu, 22 Oct 2009 06:51:30 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F0FA38FC0A;
	Thu, 22 Oct 2009 06:51:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9M6pTsW021600;
	Thu, 22 Oct 2009 06:51:29 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9M6pTR9021597;
	Thu, 22 Oct 2009 06:51:29 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910220651.n9M6pTR9021597@svn.freebsd.org>
From: Christian Brueffer 
Date: Thu, 22 Oct 2009 06:51:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198358 - head/sys/dev/ppbus
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 06:51:30 -0000

Author: brueffer
Date: Thu Oct 22 06:51:29 2009
New Revision: 198358
URL: http://svn.freebsd.org/changeset/base/198358

Log:
  Check pointer for NULL before dereferencing it, not after.
  
  PR:		138387, 138388
  Submitted by:	Patroklos Argyroudis 
  MFC after:	1 week

Modified:
  head/sys/dev/ppbus/lpt.c
  head/sys/dev/ppbus/pcfclock.c

Modified: head/sys/dev/ppbus/lpt.c
==============================================================================
--- head/sys/dev/ppbus/lpt.c	Thu Oct 22 06:17:04 2009	(r198357)
+++ head/sys/dev/ppbus/lpt.c	Thu Oct 22 06:51:29 2009	(r198358)
@@ -486,12 +486,15 @@ lptopen(struct cdev *dev, int flags, int
 {
 	int trys, err;
 	struct lpt_data *sc = dev->si_drv1;
-	device_t lptdev = sc->sc_dev;
-	device_t ppbus = device_get_parent(lptdev);
+	device_t lptdev;
+	device_t ppbus;
 
 	if (!sc)
 		return (ENXIO);
 
+	lptdev = sc->sc_dev;
+	ppbus = device_get_parent(lptdev);
+
 	ppb_lock(ppbus);
 	if (sc->sc_state) {
 		lprintf(("%s: still open %x\n", device_get_nameunit(lptdev),

Modified: head/sys/dev/ppbus/pcfclock.c
==============================================================================
--- head/sys/dev/ppbus/pcfclock.c	Thu Oct 22 06:17:04 2009	(r198357)
+++ head/sys/dev/ppbus/pcfclock.c	Thu Oct 22 06:51:29 2009	(r198358)
@@ -150,12 +150,14 @@ static int
 pcfclock_open(struct cdev *dev, int flag, int fms, struct thread *td)
 {
 	struct pcfclock_data *sc = dev->si_drv1;
-	device_t pcfclockdev = sc->dev;
-	device_t ppbus = device_get_parent(pcfclockdev);
+	device_t pcfclockdev;
+	device_t ppbus;
 	int res;
 
 	if (!sc)
 		return (ENXIO);
+	pcfclockdev = sc->dev;
+	ppbus = device_get_parent(pcfclockdev);
 
 	ppb_lock(ppbus);
 	res = ppb_request_bus(ppbus, pcfclockdev,

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 07:07:21 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BD1E1065672;
	Thu, 22 Oct 2009 07:07:21 +0000 (UTC)
	(envelope-from rdivacky@vlk.vlakno.cz)
Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190])
	by mx1.freebsd.org (Postfix) with ESMTP id B77058FC17;
	Thu, 22 Oct 2009 07:07:20 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id ADD979CB29E;
	Thu, 22 Oct 2009 09:06:40 +0200 (CEST)
X-Virus-Scanned: amavisd-new at vlakno.cz
Received: from vlakno.cz ([127.0.0.1])
	by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id M5-NisHRc9nv; Thu, 22 Oct 2009 09:06:38 +0200 (CEST)
Received: from vlk.vlakno.cz (localhost [127.0.0.1])
	by vlakno.cz (Postfix) with ESMTP id 57C829CB43E;
	Thu, 22 Oct 2009 09:06:38 +0200 (CEST)
Received: (from rdivacky@localhost)
	by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n9M76c9b099013;
	Thu, 22 Oct 2009 09:06:38 +0200 (CEST) (envelope-from rdivacky)
Date: Thu, 22 Oct 2009 09:06:38 +0200
From: Roman Divacky 
To: Ruslan Ermilov 
Message-ID: <20091022070638.GA97875@freebsd.org>
References: <200910211707.n9LH7kHx005204@svn.freebsd.org>
	<20091021210707.GB5410@edoofus.dev.vega.ru>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20091021210707.GB5410@edoofus.dev.vega.ru>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198335 - head/share/mk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 07:07:21 -0000

On Thu, Oct 22, 2009 at 01:07:07AM +0400, Ruslan Ermilov wrote:
> On Wed, Oct 21, 2009 at 05:07:46PM +0000, Roman Divacky wrote:
> > Author: rdivacky
> > Date: Wed Oct 21 17:07:46 2009
> > New Revision: 198335
> > URL: http://svn.freebsd.org/changeset/base/198335
> > 
> > Log:
> >   Set CSTD in all cases except when CC=icc and NO_WARNS is set. This
> >   way we can set desired C standard even for cross tools etc.
> >   
> I think you meant to say "always set CFLAGS based on CSTD".
> Unfortunately the actual change does not only that, it also
> breaks NO_WARNS (by ignoring it) for anything that's not "icc".

yes, it sets the C standard regardless of NO_WARNS


> It also breaks "icc" compiles without NO_WARNS by passing
> unrecognized flags to the compiler.  A correct change would
> be to move setting of CFLAGS based on CSTD out of the control
> of NO_WARNS, like this:

previously it did:

NO_WARNS ICC	CFLAGS includes CSTD
0	 0	1
0	 1	0
1	 0	0
1	 1	0


now it does

NO_WARNS ICC	CFLAGS includes CSTD
0	 0	1
0	 1	1
1	 0	1
1	 1	0

so you are saying that for ICC and !NO_WARNS the CFLAGS should not
include CSTD? ie:

NO_WARNS ICC	CFLAGS includes CSTD
0	 0	1
0	 1	0
1	 0	1
1	 1	0

am I right? my intention was to set the C standard regardless of NO_WARNS
for "clang" (because it default to C99 and gcc breaks with it).

feel free to fix my commit if this is the case

thank you

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 08:38:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF40E1065670;
	Thu, 22 Oct 2009 08:38:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE9468FC1A;
	Thu, 22 Oct 2009 08:38:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9M8cR6a023625;
	Thu, 22 Oct 2009 08:38:27 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9M8cRtq023623;
	Thu, 22 Oct 2009 08:38:27 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <200910220838.n9M8cRtq023623@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Thu, 22 Oct 2009 08:38:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198361 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 08:38:27 -0000

Author: pjd
Date: Thu Oct 22 08:38:27 2009
New Revision: 198361
URL: http://svn.freebsd.org/changeset/base/198361

Log:
  Remove self-reference.

Modified:
  head/share/man/man4/mac_mls.4

Modified: head/share/man/man4/mac_mls.4
==============================================================================
--- head/share/man/man4/mac_mls.4	Thu Oct 22 08:36:08 2009	(r198360)
+++ head/share/man/man4/mac_mls.4	Thu Oct 22 08:38:27 2009	(r198361)
@@ -212,7 +212,6 @@ allow the superuser to bypass MLS protec
 .Xr mac_bsdextended 4 ,
 .Xr mac_ifoff 4 ,
 .Xr mac_lomac 4 ,
-.Xr mac_mls 4 ,
 .Xr mac_none 4 ,
 .Xr mac_partition 4 ,
 .Xr mac_portacl 4 ,

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 09:10:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 610C1106566C;
	Thu, 22 Oct 2009 09:10:15 +0000 (UTC)
	(envelope-from raj@semihalf.com)
Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109])
	by mx1.freebsd.org (Postfix) with ESMTP id 0E2328FC15;
	Thu, 22 Oct 2009 09:10:14 +0000 (UTC)
Received: from localhost (unknown [213.17.239.109])
	by smtp.semihalf.com (Postfix) with ESMTP id 6822FC3BA2;
	Thu, 22 Oct 2009 11:04:51 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at semihalf.com
Received: from smtp.semihalf.com ([213.17.239.109])
	by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new,
	port 10024)
	with ESMTP id wByypEEbg6be; Thu, 22 Oct 2009 11:04:50 +0200 (CEST)
Received: from [10.0.0.34] (cardhu.semihalf.com [213.17.239.108])
	by smtp.semihalf.com (Postfix) with ESMTPSA id B2631C3B9C;
	Thu, 22 Oct 2009 11:04:50 +0200 (CEST)
Mime-Version: 1.0 (Apple Message framework v1076)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
From: Rafal Jaworowski 
In-Reply-To: <200910211838.n9LIc2wp007206@svn.freebsd.org>
Date: Thu, 22 Oct 2009 11:10:12 +0200
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <200910211838.n9LIc2wp007206@svn.freebsd.org>
To: Marcel Moolenaar 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv
	i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim
	powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64
	sun4v/sun4v vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 09:10:15 -0000


On 2009-10-21, at 20:38, Marcel Moolenaar wrote:

>  The key property of this change is that the I-cache is made coherent
>  *after* writes have been done. Doing it in the PMAP layer when adding
>  or changing a mapping means that the I-cache is made coherent  
> *before*
>  any writes happen. The difference is key when the I-cache prefetches.

Marcel, does this new approach help with your problems on MV-78xxx  
with SATA when executing binaries was failing with various signals  
etc. (and the suspicions were this was due to some i-cache incoherency)?

Rafal


From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 11:35:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8AE6110656A4;
	Thu, 22 Oct 2009 11:35:12 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 799DF8FC12;
	Thu, 22 Oct 2009 11:35:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MBZCZW028908;
	Thu, 22 Oct 2009 11:35:12 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MBZCun028905;
	Thu, 22 Oct 2009 11:35:12 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <200910221135.n9MBZCun028905@svn.freebsd.org>
From: Christian Brueffer 
Date: Thu, 22 Oct 2009 11:35:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198363 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 11:35:12 -0000

Author: brueffer
Date: Thu Oct 22 11:35:12 2009
New Revision: 198363
URL: http://svn.freebsd.org/changeset/base/198363

Log:
  List more dependencies for these drivers. While here, convert
  atapicam(4) to use our standard section 4 SYNOPSIS layout.
  
  PR:		132525
  Submitted by:	gcooper
  MFC after:	3 days

Modified:
  head/share/man/man4/atapicam.4
  head/share/man/man4/umass.4

Modified: head/share/man/man4/atapicam.4
==============================================================================
--- head/share/man/man4/atapicam.4	Thu Oct 22 09:39:32 2009	(r198362)
+++ head/share/man/man4/atapicam.4	Thu Oct 22 11:35:12 2009	(r198363)
@@ -27,14 +27,29 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 23, 2002
+.Dd October 22, 2009
 .Dt ATAPICAM 4
 .Os
 .Sh NAME
 .Nm atapicam
 .Nd CAM XPT (transport) module for ATAPI devices
 .Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device scbus"
+.Cd "device cam"
+.Cd "device ata"
 .Cd "device atapicam"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+atapicam_load="YES"
+.Ed
 .Sh DESCRIPTION
 The ATAPI/CAM module allows ATAPI devices (CD-ROM, CD-RW, DVD drives,
 floppy drives such as Iomega Zip, tape drives) to be accessed through

Modified: head/share/man/man4/umass.4
==============================================================================
--- head/share/man/man4/umass.4	Thu Oct 22 09:39:32 2009	(r198362)
+++ head/share/man/man4/umass.4	Thu Oct 22 11:35:12 2009	(r198363)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 22, 2006
+.Dd October 22, 2009
 .Dt UMASS 4
 .Os
 .Sh NAME
@@ -38,6 +38,9 @@ To compile this driver into the kernel,
 place the following line in your
 kernel configuration file:
 .Bd -ragged -offset indent
+.Cd "device scbus"
+.Cd "device cam"
+.Cd "device usb"
 .Cd "device umass"
 .Ed
 .Pp

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 11:45:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A2151065676;
	Thu, 22 Oct 2009 11:45:36 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ED8E38FC08;
	Thu, 22 Oct 2009 11:45:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MBjZjI029151;
	Thu, 22 Oct 2009 11:45:35 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MBjZ1k029149;
	Thu, 22 Oct 2009 11:45:35 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200910221145.n9MBjZ1k029149@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Thu, 22 Oct 2009 11:45:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198365 - head/share/mk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 11:45:36 -0000

Author: ru
Date: Thu Oct 22 11:45:35 2009
New Revision: 198365
URL: http://svn.freebsd.org/changeset/base/198365

Log:
  Unbreak NO_WARNS, keeping CSTD effect on CFLAGS out of its control.
  Unbreak compiles with icc.

Modified:
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.sys.mk
==============================================================================
--- head/share/mk/bsd.sys.mk	Thu Oct 22 11:38:19 2009	(r198364)
+++ head/share/mk/bsd.sys.mk	Thu Oct 22 11:45:35 2009	(r198365)
@@ -11,7 +11,7 @@
 # the default is gnu99 for now
 CSTD		?= gnu99
 
-.if !defined(NO_WARNS) || ${CC} != "icc"
+.if ${CC} != "icc"
 . if ${CSTD} == "k&r"
 CFLAGS		+= -traditional
 . elif ${CSTD} == "c89" || ${CSTD} == "c90"
@@ -23,6 +23,8 @@ CFLAGS		+= -std=iso9899:1999
 . else
 CFLAGS		+= -std=${CSTD}
 . endif
+.endif
+.if !defined(NO_WARNS) && ${CC} != "icc"
 # -pedantic is problematic because it also imposes namespace restrictions
 #CFLAGS		+= -pedantic
 . if defined(WARNS)

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 11:48:38 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2B3F106566B;
	Thu, 22 Oct 2009 11:48:38 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from mail.vega.ru (mail.vega.ru [90.156.167.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 5CE4C8FC1E;
	Thu, 22 Oct 2009 11:48:38 +0000 (UTC)
Received: from [10.100.124.99] (port=63272 helo=edoofus.dev.vega.ru)
	by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1N0w9l-000Cjh-6Q; Thu, 22 Oct 2009 15:48:37 +0400
Date: Thu, 22 Oct 2009 15:48:32 +0400
From: Ruslan Ermilov 
To: Roman Divacky 
Message-ID: <20091022114832.GA21442@edoofus.dev.vega.ru>
References: <200910211707.n9LH7kHx005204@svn.freebsd.org>
	<20091021210707.GB5410@edoofus.dev.vega.ru>
	<20091022070638.GA97875@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20091022070638.GA97875@freebsd.org>
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r198335 - head/share/mk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 11:48:38 -0000

Hi,

On Thu, Oct 22, 2009 at 09:06:38AM +0200, Roman Divacky wrote:
> On Thu, Oct 22, 2009 at 01:07:07AM +0400, Ruslan Ermilov wrote:
> > On Wed, Oct 21, 2009 at 05:07:46PM +0000, Roman Divacky wrote:
> > > Author: rdivacky
> > > Date: Wed Oct 21 17:07:46 2009
> > > New Revision: 198335
> > > URL: http://svn.freebsd.org/changeset/base/198335
> > > 
> > > Log:
> > >   Set CSTD in all cases except when CC=icc and NO_WARNS is set. This
> > >   way we can set desired C standard even for cross tools etc.
> > >   
> > I think you meant to say "always set CFLAGS based on CSTD".
> > Unfortunately the actual change does not only that, it also
> > breaks NO_WARNS (by ignoring it) for anything that's not "icc".
> 
> yes, it sets the C standard regardless of NO_WARNS

But it does NOT only that, it also causes NO_WARNS to be a no-op
(see below).

> > It also breaks "icc" compiles without NO_WARNS by passing
> > unrecognized flags to the compiler.  A correct change would
> > be to move setting of CFLAGS based on CSTD out of the control
> > of NO_WARNS, like this:
> 
> previously it did:
> 
> NO_WARNS ICC	CFLAGS includes CSTD
> 0	 0	1
> 0	 1	0
> 1	 0	0
> 1	 1	0
> 
> 
> now it does
> 
> NO_WARNS ICC	CFLAGS includes CSTD
> 0	 0	1
> 0	 1	1
> 1	 0	1
> 1	 1	0
> 
> so you are saying that for ICC and !NO_WARNS the CFLAGS should not
> include CSTD? ie:
> 
> NO_WARNS ICC	CFLAGS includes CSTD
> 0	 0	1
> 0	 1	0
> 1	 0	1
> 1	 1	0
> 
> am I right? my intention was to set the C standard regardless of NO_WARNS
> for "clang" (because it default to C99 and gcc breaks with it).

I understand your intentions.  icc has different command-line options
to support conformance to standards, mostly incompatible with gcc.
>From a manpage:

: -ansi
:     Support all ANSI standard C programs, equivalent to the -ansi option of gcc. 
: -[no-]c99
:     Enable [disable] C99 support for C programs. 
: -std=c99
:     Enable C99 support for C programs 
: -strict-ansi
:     Select strict ANSI C/C++ conformance dialect 

> feel free to fix my commit if this is the case

Your commit also causes warning options (those starting with -W) to leak
into CFLAGS when NO_WARNS is set, thus making NO_WARNS a no-op, and that
is a bigger problem I was talking about.

Before your change:
# make -f bsd.own.mk -f bsd.sys.mk WARNS=6 -DNO_WARNS CSTD=c99 -V CFLAGS
-O2 -pipe  -fstack-protector 

After your change:
# make -f bsd.own.mk -f bsd.sys.mk WARNS=6 -DNO_WARNS CSTD=c99 -V CFLAGS
-O2 -pipe  -std=iso9899:1999 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign

With my fix:
# make -f bsd.own.mk -f bsd.sys.mk WARNS=6 -DNO_WARNS CSTD=c99 -V CFLAGS
-O2 -pipe  -std=iso9899:1999 -fstack-protector 

FYI, I've committed my fix.


Cheers,
-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 12:47:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0844E106566C;
	Thu, 22 Oct 2009 12:47:04 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id CE6EF8FC1B;
	Thu, 22 Oct 2009 12:47:03 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 6851546B53;
	Thu, 22 Oct 2009 08:47:03 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 6D7448A01D;
	Thu, 22 Oct 2009 08:47:02 -0400 (EDT)
From: John Baldwin 
To: Christian Brueffer 
Date: Thu, 22 Oct 2009 07:55:28 -0400
User-Agent: KMail/1.9.7
References: <200910220651.n9M6pTR9021597@svn.freebsd.org>
In-Reply-To: <200910220651.n9M6pTR9021597@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200910220755.28806.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Thu, 22 Oct 2009 08:47:02 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198358 - head/sys/dev/ppbus
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 12:47:04 -0000

On Thursday 22 October 2009 2:51:29 am Christian Brueffer wrote:
> Author: brueffer
> Date: Thu Oct 22 06:51:29 2009
> New Revision: 198358
> URL: http://svn.freebsd.org/changeset/base/198358
> 
> Log:
>   Check pointer for NULL before dereferencing it, not after.
>   
>   PR:		138387, 138388
>   Submitted by:	Patroklos Argyroudis 
>   MFC after:	1 week

In this case the '!sc' check should just be removed.  It will never be true.  
I think this is also probably true of many of the other cases you are running 
into.

> Modified:
>   head/sys/dev/ppbus/lpt.c
>   head/sys/dev/ppbus/pcfclock.c
> 
> Modified: head/sys/dev/ppbus/lpt.c
> 
==============================================================================
> --- head/sys/dev/ppbus/lpt.c	Thu Oct 22 06:17:04 2009	(r198357)
> +++ head/sys/dev/ppbus/lpt.c	Thu Oct 22 06:51:29 2009	(r198358)
> @@ -486,12 +486,15 @@ lptopen(struct cdev *dev, int flags, int
>  {
>  	int trys, err;
>  	struct lpt_data *sc = dev->si_drv1;
> -	device_t lptdev = sc->sc_dev;
> -	device_t ppbus = device_get_parent(lptdev);
> +	device_t lptdev;
> +	device_t ppbus;
>  
>  	if (!sc)
>  		return (ENXIO);
>  
> +	lptdev = sc->sc_dev;
> +	ppbus = device_get_parent(lptdev);
> +
>  	ppb_lock(ppbus);
>  	if (sc->sc_state) {
>  		lprintf(("%s: still open %x\n", device_get_nameunit(lptdev),
> 
> Modified: head/sys/dev/ppbus/pcfclock.c
> 
==============================================================================
> --- head/sys/dev/ppbus/pcfclock.c	Thu Oct 22 06:17:04 2009	(r198357)
> +++ head/sys/dev/ppbus/pcfclock.c	Thu Oct 22 06:51:29 2009	(r198358)
> @@ -150,12 +150,14 @@ static int
>  pcfclock_open(struct cdev *dev, int flag, int fms, struct thread *td)
>  {
>  	struct pcfclock_data *sc = dev->si_drv1;
> -	device_t pcfclockdev = sc->dev;
> -	device_t ppbus = device_get_parent(pcfclockdev);
> +	device_t pcfclockdev;
> +	device_t ppbus;
>  	int res;
>  
>  	if (!sc)
>  		return (ENXIO);
> +	pcfclockdev = sc->dev;
> +	ppbus = device_get_parent(pcfclockdev);
>  
>  	ppb_lock(ppbus);
>  	res = ppb_request_bus(ppbus, pcfclockdev,
> 



-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 12:48:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D1264106568D;
	Thu, 22 Oct 2009 12:48:17 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C07918FC21;
	Thu, 22 Oct 2009 12:48:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MCmHSl030409;
	Thu, 22 Oct 2009 12:48:17 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MCmHMS030408;
	Thu, 22 Oct 2009 12:48:17 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910221248.n9MCmHMS030408@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 22 Oct 2009 12:48:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198366 - head/sys/dev/mwl
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 12:48:17 -0000

Author: rpaulo
Date: Thu Oct 22 12:48:17 2009
New Revision: 198366
URL: http://svn.freebsd.org/changeset/base/198366

Log:
  Don't use BUS_DMA_ALLOCNOW as that causes the attachment to fail on
  Cambria boards.
  
  MFC after:	2 months

Modified:
  head/sys/dev/mwl/if_mwl_pci.c

Modified: head/sys/dev/mwl/if_mwl_pci.c
==============================================================================
--- head/sys/dev/mwl/if_mwl_pci.c	Thu Oct 22 11:45:35 2009	(r198365)
+++ head/sys/dev/mwl/if_mwl_pci.c	Thu Oct 22 12:48:17 2009	(r198366)
@@ -204,7 +204,7 @@ mwl_pci_attach(device_t dev)
 			       BUS_SPACE_MAXADDR,	/* maxsize */
 			       MWL_TXDESC,		/* nsegments */
 			       BUS_SPACE_MAXADDR,	/* maxsegsize */
-			       BUS_DMA_ALLOCNOW,	/* flags */
+			       0,			/* flags */
 			       NULL,			/* lockfunc */
 			       NULL,			/* lockarg */
 			       &sc->sc_dmat)) {

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 14:53:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9513E106566B;
	Thu, 22 Oct 2009 14:53:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 844628FC18;
	Thu, 22 Oct 2009 14:53:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MEriAd032823;
	Thu, 22 Oct 2009 14:53:44 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MEriMh032821;
	Thu, 22 Oct 2009 14:53:44 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910221453.n9MEriMh032821@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 22 Oct 2009 14:53:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198367 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 14:53:44 -0000

Author: jhb
Date: Thu Oct 22 14:53:44 2009
New Revision: 198367
URL: http://svn.freebsd.org/changeset/base/198367

Log:
  Set the devclass_t pointer specified in the DRIVER_MODULE() macro
  sooner so it is always valid when a driver's identify routine is
  called.  Previously, new-bus would attempt to create the devclass for
  a newly loaded driver in two separate places, once in
  devclass_add_driver(), and again after devclass_add_driver() returned
  in driver_module_handler().  Only the second lookup attempted to set a
  device class' parent and set the devclass_t pointer specified in the
  DRIVER_MODULE() macro.  However, by the time it was executed, the
  driver was already added to existing instances of the parent driver at
  which point in time the new driver's identify routine would have been
  invoked.  The fix is to merge the two attempts and only create the
  devclass once in devclass_add_driver() including setting the
  devclass_t pointer passed to DRIVER_MODULE() before the driver is
  added to any existing bus devices.
  
  Reported by:	avg
  Reviewed by:	imp
  MFC after:	2 weeks

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Thu Oct 22 12:48:17 2009	(r198366)
+++ head/sys/kern/subr_bus.c	Thu Oct 22 14:53:44 2009	(r198367)
@@ -1049,9 +1049,10 @@ devclass_driver_added(devclass_t dc, dri
  * @param driver	the driver to register
  */
 static int
-devclass_add_driver(devclass_t dc, driver_t *driver, int pass)
+devclass_add_driver(devclass_t dc, driver_t *driver, int pass, devclass_t *dcp)
 {
 	driverlink_t dl;
+	const char *parentname;
 
 	PDEBUG(("%s", DRIVERNAME(driver)));
 
@@ -1072,9 +1073,17 @@ devclass_add_driver(devclass_t dc, drive
 	kobj_class_compile((kobj_class_t) driver);
 
 	/*
-	 * Make sure the devclass which the driver is implementing exists.
+	 * If the driver has any base classes, make the
+	 * devclass inherit from the devclass of the driver's
+	 * first base class. This will allow the system to
+	 * search for drivers in both devclasses for children
+	 * of a device using this driver.
 	 */
-	devclass_find_internal(driver->name, NULL, TRUE);
+	if (driver->baseclasses)
+		parentname = driver->baseclasses[0]->name;
+	else
+		parentname = NULL;
+	*dcp = devclass_find_internal(driver->name, parentname, TRUE);
 
 	dl->driver = driver;
 	TAILQ_INSERT_TAIL(&dc->drivers, dl, link);
@@ -4157,27 +4166,8 @@ driver_module_handler(module_t mod, int 
 		driver = dmd->dmd_driver;
 		PDEBUG(("Loading module: driver %s on bus %s (pass %d)",
 		    DRIVERNAME(driver), dmd->dmd_busname, pass));
-		error = devclass_add_driver(bus_devclass, driver, pass);
-		if (error)
-			break;
-
-		/*
-		 * If the driver has any base classes, make the
-		 * devclass inherit from the devclass of the driver's
-		 * first base class. This will allow the system to
-		 * search for drivers in both devclasses for children
-		 * of a device using this driver.
-		 */
-		if (driver->baseclasses) {
-			const char *parentname;
-			parentname = driver->baseclasses[0]->name;
-			*dmd->dmd_devclass =
-				devclass_find_internal(driver->name,
-				    parentname, TRUE);
-		} else {
-			*dmd->dmd_devclass =
-				devclass_find_internal(driver->name, NULL, TRUE);
-		}
+		error = devclass_add_driver(bus_devclass, driver, pass,
+		    dmd->dmd_devclass);
 		break;
 
 	case MOD_UNLOAD:

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 16:22:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D95B1065672;
	Thu, 22 Oct 2009 16:22:00 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104])
	by mx1.freebsd.org (Postfix) with ESMTP id 72B8A8FC1A;
	Thu, 22 Oct 2009 16:22:00 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii; format=flowed; delsp=yes
Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36])
	by asmtp029.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KRX004BLC45YI80@asmtp029.mac.com>; Thu,
	22 Oct 2009 09:21:46 -0700 (PDT)
From: Marcel Moolenaar 
In-reply-to: 
Date: Thu, 22 Oct 2009 09:21:40 -0700
Message-id: <97E86964-5F25-4C03-8A04-FBC65345234D@mac.com>
References: <200910211838.n9LIc2wp007206@svn.freebsd.org>
	
To: Rafal Jaworowski 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	Marcel Moolenaar , src-committers@freebsd.org
Subject: Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv
 i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke
 powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 16:22:00 -0000


On Oct 22, 2009, at 2:10 AM, Rafal Jaworowski wrote:

>
> On 2009-10-21, at 20:38, Marcel Moolenaar wrote:
>
>> The key property of this change is that the I-cache is made coherent
>> *after* writes have been done. Doing it in the PMAP layer when adding
>> or changing a mapping means that the I-cache is made coherent  
>> *before*
>> any writes happen. The difference is key when the I-cache prefetches.
>
> Marcel, does this new approach help with your problems on MV-78xxx  
> with SATA when executing binaries was failing with various signals  
> etc. (and the suspicions were this was due to some i-cache  
> incoherency)?

This commit only adds I-cache synchronisation to ptrace(2) so
that breakpoints work reliably. Note that the PMAP layer for
ARM needs to have a proper implementation, because breakpoints
don't work reliably. Unfortunately, the PMAP code is not well
suited for non-current PMAP operations. I'm looking into it...

In any case: I'll be working on moving I-cache coherency from
PMAP to MI where sensible to make sure we synchronize after the
memory update and not before (or multiple times in an attempt
to plaster over the cracks). I expect that in the end it'll
have helped... :-)

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 17:30:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CDB23106568F;
	Thu, 22 Oct 2009 17:30:22 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BD5318FC1F;
	Thu, 22 Oct 2009 17:30:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MHUMKN035865;
	Thu, 22 Oct 2009 17:30:22 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MHUMnZ035863;
	Thu, 22 Oct 2009 17:30:22 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910221730.n9MHUMnZ035863@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 22 Oct 2009 17:30:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198369 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 17:30:22 -0000

Author: rpaulo
Date: Thu Oct 22 17:30:22 2009
New Revision: 198369
URL: http://svn.freebsd.org/changeset/base/198369

Log:
  Initialize rann_flags properly.
  
  MFC after:	2 days

Modified:
  head/sys/net80211/ieee80211_hwmp.c

Modified: head/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- head/sys/net80211/ieee80211_hwmp.c	Thu Oct 22 16:26:38 2009	(r198368)
+++ head/sys/net80211/ieee80211_hwmp.c	Thu Oct 22 17:30:22 2009	(r198369)
@@ -653,6 +653,7 @@ hwmp_rootmode_rann_cb(void *arg)
 	IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, vap->iv_bss,
 	    "%s", "send broadcast RANN");
 
+	rann.rann_flags = 0;
 	if (ms->ms_flags & IEEE80211_MESHFLAGS_PORTAL)
 		rann.rann_flags |= IEEE80211_MESHRANN_FLAGS_PR;
 	rann.rann_hopcount = 0;

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 20:44:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 83F8F106566B;
	Thu, 22 Oct 2009 20:44:56 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 73A0A8FC18;
	Thu, 22 Oct 2009 20:44:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MKiuRn039594;
	Thu, 22 Oct 2009 20:44:56 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MKiubT039592;
	Thu, 22 Oct 2009 20:44:56 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910222044.n9MKiubT039592@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 22 Oct 2009 20:44:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198372 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 20:44:56 -0000

Author: mav
Date: Thu Oct 22 20:44:55 2009
New Revision: 198372
URL: http://svn.freebsd.org/changeset/base/198372

Log:
  cam_ccbq_fini() declared for 11 years, but never implemented. Remove it.

Modified:
  head/sys/cam/cam_queue.h

Modified: head/sys/cam/cam_queue.h
==============================================================================
--- head/sys/cam/cam_queue.h	Thu Oct 22 18:48:25 2009	(r198371)
+++ head/sys/cam/cam_queue.h	Thu Oct 22 20:44:55 2009	(r198372)
@@ -96,8 +96,6 @@ int		cam_ccbq_init(struct cam_ccbq *ccbq
 
 void		cam_ccbq_free(struct cam_ccbq *ccbq);
 
-void		cam_ccbq_fini(struct cam_ccbq *ccbq);
-
 /*
  * Allocate and initialize a cam_queue structure.
  */

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 20:54:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E9DE5106566C;
	Thu, 22 Oct 2009 20:54:01 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D8B498FC15;
	Thu, 22 Oct 2009 20:54:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MKs1Xk039780;
	Thu, 22 Oct 2009 20:54:01 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MKs1kX039778;
	Thu, 22 Oct 2009 20:54:01 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200910222054.n9MKs1kX039778@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 22 Oct 2009 20:54:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198373 - head/sys/dev/usb/input
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 20:54:02 -0000

Author: thompsa
Date: Thu Oct 22 20:54:01 2009
New Revision: 198373
URL: http://svn.freebsd.org/changeset/base/198373

Log:
  Allow dumping the USB mouse reports via 'sysctl -b dev.ums.N.parseinfo',
  previously only available via bootverbose.
  
  PR:		usb/137191
  Submitted by:	Eygene Ryabinkin

Modified:
  head/sys/dev/usb/input/ums.c

Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c	Thu Oct 22 20:44:55 2009	(r198372)
+++ head/sys/dev/usb/input/ums.c	Thu Oct 22 20:54:01 2009	(r198373)
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -161,7 +162,9 @@ static usb_fifo_open_t ums_open;
 static usb_fifo_close_t ums_close;
 static usb_fifo_ioctl_t ums_ioctl;
 
-static void ums_put_queue(struct ums_softc *sc, int32_t dx, int32_t dy, int32_t dz, int32_t dt, int32_t buttons);
+static void	ums_put_queue(struct ums_softc *, int32_t, int32_t,
+		    int32_t, int32_t, int32_t);
+static int	ums_sysctl_handler_parseinfo(SYSCTL_HANDLER_ARGS);
 
 static struct usb_fifo_methods ums_fifo_methods = {
 	.f_open = &ums_open,
@@ -643,6 +646,12 @@ ums_attach(device_t dev)
 	if (err) {
 		goto detach;
 	}
+	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+	    OID_AUTO, "parseinfo", CTLTYPE_STRING|CTLFLAG_RD,
+	    sc, 0, ums_sysctl_handler_parseinfo,
+	    "", "Dump UMS report parsing information");
+
 	return (0);
 
 detach:
@@ -916,6 +925,67 @@ done:
 	return (error);
 }
 
+static int
+ums_sysctl_handler_parseinfo(SYSCTL_HANDLER_ARGS)
+{
+	struct ums_softc *sc = arg1;
+	struct ums_info *info;
+	struct sbuf *sb;
+	int i, j, err;
+
+	sb = sbuf_new_auto();
+	for (i = 0; i < UMS_INFO_MAX; i++) {
+		info = &sc->sc_info[i];
+
+		/* Don't emit empty info */
+		if ((info->sc_flags &
+		    (UMS_FLAG_X_AXIS | UMS_FLAG_Y_AXIS | UMS_FLAG_Z_AXIS |
+		     UMS_FLAG_T_AXIS | UMS_FLAG_W_AXIS)) == 0 &&
+		    info->sc_buttons == 0)
+			continue;
+
+		sbuf_printf(sb, "i%d:", i + 1);
+		if (info->sc_flags & UMS_FLAG_X_AXIS)
+			sbuf_printf(sb, " X:r%d, p%d, s%d;",
+			    (int)info->sc_iid_x,
+			    (int)info->sc_loc_x.pos,
+			    (int)info->sc_loc_x.size);
+		if (info->sc_flags & UMS_FLAG_Y_AXIS)
+			sbuf_printf(sb, " Y:r%d, p%d, s%d;",
+			    (int)info->sc_iid_y,
+			    (int)info->sc_loc_y.pos,
+			    (int)info->sc_loc_y.size);
+		if (info->sc_flags & UMS_FLAG_Z_AXIS)
+			sbuf_printf(sb, " Z:r%d, p%d, s%d;",
+			    (int)info->sc_iid_z,
+			    (int)info->sc_loc_z.pos,
+			    (int)info->sc_loc_z.size);
+		if (info->sc_flags & UMS_FLAG_T_AXIS)
+			sbuf_printf(sb, " T:r%d, p%d, s%d;",
+			    (int)info->sc_iid_t,
+			    (int)info->sc_loc_t.pos,
+			    (int)info->sc_loc_t.size);
+		if (info->sc_flags & UMS_FLAG_W_AXIS)
+			sbuf_printf(sb, " W:r%d, p%d, s%d;",
+			    (int)info->sc_iid_w,
+			    (int)info->sc_loc_w.pos,
+			    (int)info->sc_loc_w.size);
+
+		for (j = 0; j < info->sc_buttons; j++) {
+			sbuf_printf(sb, " B%d:r%d, p%d, s%d;", j + 1,
+			    (int)info->sc_iid_btn[j],
+			    (int)info->sc_loc_btn[j].pos,
+			    (int)info->sc_loc_btn[j].size);
+		}
+		sbuf_printf(sb, "\n");
+	}
+	sbuf_finish(sb);
+	err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
+	sbuf_delete(sb);
+
+	return (err);
+}
+
 static devclass_t ums_devclass;
 
 static device_method_t ums_methods[] = {

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 20:57:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99ACE1065695;
	Thu, 22 Oct 2009 20:57:17 +0000 (UTC)
	(envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 893048FC18;
	Thu, 22 Oct 2009 20:57:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MKvH8Q039885;
	Thu, 22 Oct 2009 20:57:17 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MKvHWK039883;
	Thu, 22 Oct 2009 20:57:17 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <200910222057.n9MKvHWK039883@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 22 Oct 2009 20:57:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198374 - head/sys/tools
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 20:57:17 -0000

Author: emaste
Date: Thu Oct 22 20:57:17 2009
New Revision: 198374
URL: http://svn.freebsd.org/changeset/base/198374

Log:
  Rename default to default_function, for compatibility with GNU awk.
  (For cross-compiling out-of-tree kernel modules, for example.)

Modified:
  head/sys/tools/makeobjops.awk

Modified: head/sys/tools/makeobjops.awk
==============================================================================
--- head/sys/tools/makeobjops.awk	Thu Oct 22 20:54:01 2009	(r198373)
+++ head/sys/tools/makeobjops.awk	Thu Oct 22 20:57:17 2009	(r198374)
@@ -240,7 +240,7 @@ function handle_method (static, doc)
 		lineno++
 	}
 
-	default = "";
+	default_function = "";
 	if (!match(line, /\};?/)) {
 		warnsrc("Premature end of file");
 		error = 1;
@@ -248,9 +248,9 @@ function handle_method (static, doc)
 	}
 	extra = substr(line, RSTART + RLENGTH);
 	if (extra ~ /[	 ]*DEFAULT[ 	]*[a-zA-Z_][a-zA-Z_0-9]*[ 	]*;/) {
-		default = extra;
-		sub(/.*DEFAULT[	 ]*/, "", default);
-		sub(/[; 	]+.*$/, "", default);
+		default_function = extra;
+		sub(/.*DEFAULT[	 ]*/, "", default_function);
+		sub(/[; 	]+.*$/, "", default_function);
 	}
 	else if (extra && opt_d) {
 		#   Warn about garbage at end of line.
@@ -294,8 +294,8 @@ function handle_method (static, doc)
 
 	firstvar = varnames[1];
 
-	if (default == "")
-		default = "kobj_error_method";
+	if (default_function == "")
+		default_function = "kobj_error_method";
 
 	# the method description 
 	printh("/** @brief Unique descriptor for the " umname "() method */");
@@ -308,7 +308,7 @@ function handle_method (static, doc)
 
 	# Print out the method desc
 	printc("struct kobj_method " mname "_method_default = {");
-	printc("\t&" mname "_desc, (kobjop_t) " default);
+	printc("\t&" mname "_desc, (kobjop_t) " default_function);
 	printc("};\n");
 
 	printc("struct kobjop_desc " mname "_desc = {");

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 20:59:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85E3A106566C;
	Thu, 22 Oct 2009 20:59:52 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 752008FC13;
	Thu, 22 Oct 2009 20:59:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9MKxq2s039968;
	Thu, 22 Oct 2009 20:59:52 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9MKxq20039966;
	Thu, 22 Oct 2009 20:59:52 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200910222059.n9MKxq20039966@svn.freebsd.org>
From: Edwin Groothuis 
Date: Thu, 22 Oct 2009 20:59:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198375 - head/share/zoneinfo
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 20:59:52 -0000

Author: edwin
Date: Thu Oct 22 20:59:51 2009
New Revision: 198375
URL: http://svn.freebsd.org/changeset/base/198375

Log:
  Move comments to the beginning of the line to make it look better.
  Thank to ru@ for his noticing of it.
  
  MFC after:	1 week

Modified:
  head/share/zoneinfo/Makefile

Modified: head/share/zoneinfo/Makefile
==============================================================================
--- head/share/zoneinfo/Makefile	Thu Oct 22 20:57:17 2009	(r198374)
+++ head/share/zoneinfo/Makefile	Thu Oct 22 20:59:51 2009	(r198375)
@@ -55,11 +55,11 @@ beforeinstall:
 	    ${.CURDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
 
 afterinstall:
-	@#
-	@# If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
-	@# and the contents of it exists in /usr/share/zoneinfo, then reinstall
-	@# it.
-	@#
+#
+# If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
+# and the contents of it exists in /usr/share/zoneinfo, then reinstall
+# it.
+#
 	@if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
 	    -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
 		zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 21:01:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB39B1065693;
	Thu, 22 Oct 2009 21:01:41 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AAABA8FC19;
	Thu, 22 Oct 2009 21:01:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9ML1fq7040073;
	Thu, 22 Oct 2009 21:01:41 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ML1fT9040071;
	Thu, 22 Oct 2009 21:01:41 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200910222101.n9ML1fT9040071@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 22 Oct 2009 21:01:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198376 - head/lib/libusb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 21:01:41 -0000

Author: thompsa
Date: Thu Oct 22 21:01:41 2009
New Revision: 198376
URL: http://svn.freebsd.org/changeset/base/198376

Log:
  Prevent wraparound of the timeout variable.
  
  Submitted by:	HPS

Modified:
  head/lib/libusb/libusb20_ugen20.c

Modified: head/lib/libusb/libusb20_ugen20.c
==============================================================================
--- head/lib/libusb/libusb20_ugen20.c	Thu Oct 22 20:59:51 2009	(r198375)
+++ head/lib/libusb/libusb20_ugen20.c	Thu Oct 22 21:01:41 2009	(r198376)
@@ -800,7 +800,11 @@ ugen20_tr_submit(struct libusb20_transfe
 	if (xfer->flags & LIBUSB20_TRANSFER_DO_CLEAR_STALL) {
 		fsep->flags |= USB_FS_FLAG_CLEAR_STALL;
 	}
-	fsep->timeout = xfer->timeout;
+	/* NOTE: The "fsep->timeout" variable is 16-bit. */
+	if (xfer->timeout > 65535)
+		fsep->timeout = 65535;
+	else
+		fsep->timeout = xfer->timeout;
 
 	temp.ep_index = xfer->trIndex;
 

From owner-svn-src-head@FreeBSD.ORG  Thu Oct 22 21:07:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E6A93106566B;
	Thu, 22 Oct 2009 21:07:32 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D5F6B8FC0A;
	Thu, 22 Oct 2009 21:07:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9ML7WmB040207;
	Thu, 22 Oct 2009 21:07:32 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ML7WOW040203;
	Thu, 22 Oct 2009 21:07:32 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910222107.n9ML7WOW040203@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 22 Oct 2009 21:07:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198377 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 22 Oct 2009 21:07:33 -0000

Author: mav
Date: Thu Oct 22 21:07:32 2009
New Revision: 198377
URL: http://svn.freebsd.org/changeset/base/198377

Log:
  After thinking again, implement cam_ccbq_fini().
  This is effectively NULL change, but makes this API a bit more consistent.

Modified:
  head/sys/cam/cam_queue.c
  head/sys/cam/cam_queue.h
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_queue.c
==============================================================================
--- head/sys/cam/cam_queue.c	Thu Oct 22 21:01:41 2009	(r198376)
+++ head/sys/cam/cam_queue.c	Thu Oct 22 21:07:32 2009	(r198377)
@@ -289,7 +289,7 @@ void
 cam_ccbq_free(struct cam_ccbq *ccbq)
 {
 	if (ccbq) {
-		camq_fini(&ccbq->queue);
+		cam_ccbq_fini(ccbq);
 		free(ccbq, M_CAMCCBQ);
 	}
 }
@@ -338,6 +338,13 @@ cam_ccbq_init(struct cam_ccbq *ccbq, int
 	return (0);
 }
 
+void
+cam_ccbq_fini(struct cam_ccbq *ccbq)
+{
+
+	camq_fini(&ccbq->queue);
+}
+
 /*
  * Heap routines for manipulating CAM queues.
  */

Modified: head/sys/cam/cam_queue.h
==============================================================================
--- head/sys/cam/cam_queue.h	Thu Oct 22 21:01:41 2009	(r198376)
+++ head/sys/cam/cam_queue.h	Thu Oct 22 21:07:32 2009	(r198377)
@@ -96,6 +96,8 @@ int		cam_ccbq_init(struct cam_ccbq *ccbq
 
 void		cam_ccbq_free(struct cam_ccbq *ccbq);
 
+void		cam_ccbq_fini(struct cam_ccbq *ccbq);
+
 /*
  * Allocate and initialize a cam_queue structure.
  */

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Thu Oct 22 21:01:41 2009	(r198376)
+++ head/sys/cam/cam_xpt.c	Thu Oct 22 21:07:32 2009	(r198377)
@@ -4447,7 +4447,7 @@ xpt_release_device(struct cam_eb *bus, s
 		devq = bus->sim->devq;
 		cam_devq_resize(devq, devq->alloc_queue.array_size - 1);
 		camq_fini(&device->drvq);
-		camq_fini(&device->ccbq.queue);
+		cam_ccbq_fini(&device->ccbq);
 		free(device, M_CAMXPT);
 		xpt_release_target(bus, target);
 	}

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 03:17:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1AAA9106566B;
	Fri, 23 Oct 2009 03:17:03 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 07EB28FC0A;
	Fri, 23 Oct 2009 03:17:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9N3H3oZ047526;
	Fri, 23 Oct 2009 03:17:03 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9N3H2YP047516;
	Fri, 23 Oct 2009 03:17:02 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910230317.n9N3H2YP047516@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 23 Oct 2009 03:17:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198378 - in head/sys/powerpc: aim booke include powerpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 03:17:03 -0000

Author: nwhitehorn
Date: Fri Oct 23 03:17:02 2009
New Revision: 198378
URL: http://svn.freebsd.org/changeset/base/198378

Log:
  Add SMP support on U3-based G5 systems. This does not yet work perfectly:
  at least on my Xserve, getting the decrementer and timebase on APs to tick
  requires setting up a clock chip over I2C, which is not yet done.
  
  While here, correct the 64-bit tlbie function to set the CPU to 64-bit
  mode correctly.
  
  Hardware donated by:	grehan

Modified:
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/aim/mp_cpudep.c
  head/sys/powerpc/aim/platform_chrp.c
  head/sys/powerpc/booke/mp_cpudep.c
  head/sys/powerpc/include/pcpu.h
  head/sys/powerpc/include/smp.h
  head/sys/powerpc/include/spr.h
  head/sys/powerpc/powerpc/cpu.c
  head/sys/powerpc/powerpc/mp_machdep.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/aim/mmu_oea64.c	Fri Oct 23 03:17:02 2009	(r198378)
@@ -182,35 +182,28 @@ va_to_vsid(pmap_t pm, vm_offset_t va)
  * Just to add to the fun, exceptions must be off as well
  * so that we can't trap in 64-bit mode. What a pain.
  */
+struct mtx	tlbie_mutex;
 
 static __inline void
 TLBIE(pmap_t pmap, vm_offset_t va) {
-	register_t msr;
-	register_t scratch;
-
 	uint64_t vpn;
 	register_t vpn_hi, vpn_lo;
-
-#if 1
-	/*
-	 * CPU documentation says that tlbie takes the VPN, not the
-	 * VA. I think the code below does this correctly. We will see.
-	 */
+	register_t msr;
+	register_t scratch;
 
 	vpn = (uint64_t)(va & ADDR_PIDX);
 	if (pmap != NULL)
 		vpn |= (va_to_vsid(pmap,va) << 28);
-#else
-	vpn = va;
-#endif
 
 	vpn_hi = (uint32_t)(vpn >> 32);
 	vpn_lo = (uint32_t)vpn;
 
+	mtx_lock_spin(&tlbie_mutex);
 	__asm __volatile("\
 	    mfmsr %0; \
 	    clrldi %1,%0,49; \
-	    insrdi %1,1,1,0; \
+	    mtmsr %1; \
+	    insrdi %1,%5,1,0; \
 	    mtmsrd %1; \
 	    ptesync; \
 	    \
@@ -222,7 +215,8 @@ TLBIE(pmap_t pmap, vm_offset_t va) {
 	    eieio; \
 	    tlbsync; \
 	    ptesync;" 
-	: "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32));
+	: "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32), "r"(1));
+	mtx_unlock_spin(&tlbie_mutex);
 }
 
 #define DISABLE_TRANS(msr)	msr = mfmsr(); mtmsr(msr & ~PSL_DR); isync()
@@ -352,7 +346,7 @@ static int		moea64_pte_insert(u_int, str
  * PVO calls.
  */
 static int	moea64_pvo_enter(pmap_t, uma_zone_t, struct pvo_head *,
-		    vm_offset_t, vm_offset_t, uint64_t, int, int);
+		    vm_offset_t, vm_offset_t, uint64_t, int);
 static void	moea64_pvo_remove(struct pvo_entry *, int);
 static struct	pvo_entry *moea64_pvo_find_va(pmap_t, vm_offset_t, int *);
 static struct	lpte *moea64_pvo_to_pte(const struct pvo_entry *, int);
@@ -825,6 +819,11 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 	    MTX_RECURSE);
 
 	/*
+	 * Initialize the TLBIE lock. TLBIE can only be executed by one CPU.
+	 */
+	mtx_init(&tlbie_mutex, "tlbie mutex", NULL, MTX_SPIN);
+
+	/*
 	 * Initialise the unmanaged pvo pool.
 	 */
 	moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc(
@@ -1254,7 +1253,7 @@ moea64_enter_locked(pmap_t pmap, vm_offs
 		pvo_flags |= PVO_FAKE;
 
 	error = moea64_pvo_enter(pmap, zone, pvo_head, va, VM_PAGE_TO_PHYS(m),
-	    pte_lo, pvo_flags, 0);
+	    pte_lo, pvo_flags);
 
 	if (pmap == kernel_pmap)
 		TLBIE(pmap, va);
@@ -1427,16 +1426,15 @@ moea64_uma_page_alloc(uma_zone_t zone, i
 	if (pvo_allocator_start >= pvo_allocator_end)
 		panic("Ran out of PVO allocator buffer space!");
 
-	/* Now call pvo_enter in recursive mode */
 	moea64_pvo_enter(kernel_pmap, moea64_upvo_zone,
 	    &moea64_pvo_kunmanaged, va,  VM_PAGE_TO_PHYS(m), LPTE_M, 
-	    PVO_WIRED | PVO_BOOTSTRAP, 1);
+	    PVO_WIRED | PVO_BOOTSTRAP);
 
 	TLBIE(kernel_pmap, va);
-	
+
 	if (needed_lock)
 		PMAP_UNLOCK(kernel_pmap);
-
+	
 	if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0)
                 bzero((void *)va, PAGE_SIZE);
 
@@ -1579,7 +1577,7 @@ moea64_kenter(mmu_t mmu, vm_offset_t va,
 	PMAP_LOCK(kernel_pmap);
 	error = moea64_pvo_enter(kernel_pmap, moea64_upvo_zone,
 	    &moea64_pvo_kunmanaged, va, pa, pte_lo, 
-	    PVO_WIRED | VM_PROT_EXECUTE, 0);
+	    PVO_WIRED | VM_PROT_EXECUTE);
 
 	TLBIE(kernel_pmap, va);
 
@@ -1968,14 +1966,29 @@ static void
 tlbia(void)
 {
 	vm_offset_t i;
+	register_t msr, scratch;
 
-	for (i = 0; i < 0xFF000; i += 0x00001000) 
-		TLBIE(NULL,i);
+	for (i = 0; i < 0xFF000; i += 0x00001000) {
+		__asm __volatile("\
+		    mfmsr %0; \
+		    mr %1, %0; \
+		    insrdi %1,%3,1,0; \
+		    mtmsrd %1; \
+		    ptesync; \
+		    \
+		    tlbiel %2; \
+		    \
+		    mtmsrd %0; \
+		    eieio; \
+		    tlbsync; \
+		    ptesync;" 
+		: "=r"(msr), "=r"(scratch) : "r"(i), "r"(1));
+	}
 }
 
 static int
 moea64_pvo_enter(pmap_t pm, uma_zone_t zone, struct pvo_head *pvo_head,
-    vm_offset_t va, vm_offset_t pa, uint64_t pte_lo, int flags, int recurse)
+    vm_offset_t va, vm_offset_t pa, uint64_t pte_lo, int flags)
 {
 	struct	 pvo_entry *pvo;
 	uint64_t vsid;
@@ -2011,16 +2024,14 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z
 	 * Remove any existing mapping for this page.  Reuse the pvo entry if
 	 * there is a mapping.
 	 */
-	if (!recurse)
-		LOCK_TABLE();
+	LOCK_TABLE();
 
 	LIST_FOREACH(pvo, &moea64_pvo_table[ptegidx], pvo_olink) {
 		if (pvo->pvo_pmap == pm && PVO_VADDR(pvo) == va) {
 			if ((pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) == pa &&
 			    (pvo->pvo_pte.lpte.pte_lo & LPTE_PP) ==
 			    (pte_lo & LPTE_PP)) {
-				if (!recurse)
-					UNLOCK_TABLE();
+				UNLOCK_TABLE();
 				return (0);
 			}
 			moea64_pvo_remove(pvo, -1);
@@ -2041,12 +2052,19 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z
 		moea64_bpvo_pool_index++;
 		bootstrap = 1;
 	} else {
+		/*
+		 * Note: drop the table around the UMA allocation in
+		 * case the UMA allocator needs to manipulate the page
+		 * table. The mapping we are working with is already
+		 * protected by the PMAP lock.
+		 */
+		UNLOCK_TABLE();
 		pvo = uma_zalloc(zone, M_NOWAIT);
+		LOCK_TABLE();
 	}
 
 	if (pvo == NULL) {
-		if (!recurse)
-			UNLOCK_TABLE();
+		UNLOCK_TABLE();
 		return (ENOMEM);
 	}
 
@@ -2093,8 +2111,7 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z
 		moea64_pte_overflow++;
 	}
 
-	if (!recurse)
-		UNLOCK_TABLE();
+	UNLOCK_TABLE();
 
 	return (first ? ENOENT : 0);
 }

Modified: head/sys/powerpc/aim/mp_cpudep.c
==============================================================================
--- head/sys/powerpc/aim/mp_cpudep.c	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/aim/mp_cpudep.c	Fri Oct 23 03:17:02 2009	(r198378)
@@ -48,14 +48,34 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-extern void *rstcode;
-extern register_t l2cr_config;
-extern register_t l3cr_config;
-
 void *ap_pcpu;
 
+static register_t bsp_state[8];
+
+static void cpudep_save_config(void *dummy);
+SYSINIT(cpu_save_config, SI_SUB_CPU, SI_ORDER_ANY, cpudep_save_config, NULL);
+
+uintptr_t
+cpudep_ap_bootstrap(void)
+{
+	register_t msr, sp;
+
+	msr = PSL_KERNSET & ~PSL_EE;
+	mtmsr(msr);
+	isync();
+
+	__asm __volatile("mtsprg 0, %0" :: "r"(ap_pcpu));
+	powerpc_sync();
+
+	pcpup->pc_curthread = pcpup->pc_idlethread;
+	pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb;
+	sp = pcpup->pc_curpcb->pcb_sp;
+
+	return (sp);
+}
+
 static register_t
-l2_enable(void)
+mpc745x_l2_enable(register_t l2cr_config)
 {
 	register_t ccr;
 
@@ -77,7 +97,7 @@ l2_enable(void)
 }
 
 static register_t
-l3_enable(void)
+mpc745x_l3_enable(register_t l3cr_config)
 {
 	register_t ccr;
 
@@ -109,7 +129,7 @@ l3_enable(void)
 }
 
 static register_t
-l1d_enable(void)
+mpc745x_l1d_enable(void)
 {
 	register_t hid;
 
@@ -127,7 +147,7 @@ l1d_enable(void)
 }
 
 static register_t
-l1i_enable(void)
+mpc745x_l1i_enable(void)
 {
 	register_t hid;
 
@@ -144,43 +164,110 @@ l1i_enable(void)
 	return (hid);
 }
 
-uint32_t
-cpudep_ap_bootstrap(void)
+static void
+cpudep_save_config(void *dummy)
 {
-	uint32_t hid, msr, reg, sp;
-
-	// reg = mfspr(SPR_MSSCR0);
-	// mtspr(SPR_MSSCR0, reg | 0x3);
-
-	__asm __volatile("mtsprg 0, %0" :: "r"(ap_pcpu));
-	powerpc_sync();
+	uint16_t	vers;
 
-	__asm __volatile("mtspr 1023,%0" :: "r"(PCPU_GET(cpuid)));
-	__asm __volatile("mfspr %0,1023" : "=r"(pcpup->pc_pir));
-
-	msr = PSL_FP | PSL_IR | PSL_DR | PSL_ME | PSL_RI;
-	powerpc_sync();
-	isync();
-	mtmsr(msr);
-	isync();
+	vers = mfpvr() >> 16;
 
-	if (l3cr_config != 0)
-		reg = l3_enable();
-	if (l2cr_config != 0)
-		reg = l2_enable();
-	reg = l1d_enable();
-	reg = l1i_enable();
-
-	hid = mfspr(SPR_HID0);
-	hid &= ~(HID0_DOZE | HID0_SLEEP);
-	hid |= HID0_NAP | HID0_DPM;
-	mtspr(SPR_HID0, hid);
-	isync();
-
-	pcpup->pc_curthread = pcpup->pc_idlethread;
-	pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb;
-	sp = pcpup->pc_curpcb->pcb_sp;
+	switch(vers) {
+	case IBM970:
+	case IBM970FX:
+	case IBM970MP:
+		__asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32"
+		    : "=r" (bsp_state[0]),"=r" (bsp_state[1]) : "K" (SPR_HID0));
+		__asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32"
+		    : "=r" (bsp_state[2]),"=r" (bsp_state[3]) : "K" (SPR_HID1));
+		__asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32"
+		    : "=r" (bsp_state[4]),"=r" (bsp_state[5]) : "K" (SPR_HID4));
+		__asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32"
+		    : "=r" (bsp_state[6]),"=r" (bsp_state[7]) : "K" (SPR_HID5));
+
+		break;
+	case MPC7450:
+	case MPC7455:
+	case MPC7457:
+		/* Only MPC745x CPUs have an L3 cache. */
+		bsp_state[3] = mfspr(SPR_L3CR);
+
+		/* Fallthrough */
+	case MPC7400:
+	case MPC7410:
+	case MPC7447A:
+	case MPC7448:
+		bsp_state[2] = mfspr(SPR_L2CR);
+		bsp_state[1] = mfspr(SPR_HID1);
+		bsp_state[0] = mfspr(SPR_HID0);
+		break;
+	}
+}
 
-	return (sp);
+void
+cpudep_ap_setup()
+{ 
+	register_t	reg;
+	uint16_t	vers;
+
+	vers = mfpvr() >> 16;
+
+	switch(vers) {
+	case IBM970:
+	case IBM970FX:
+	case IBM970MP:
+		/* Set HIOR to 0 */
+		__asm __volatile("mtspr 311,%0" :: "r"(0));
+		powerpc_sync();
+
+		/*
+		 * The 970 has strange rules about how to update HID registers.
+		 * See Table 2-3, 970MP manual
+		 */
+
+		__asm __volatile(" \
+			ld	%0,0(%2);				\
+			mtspr	%1, %0;					\
+			mfspr	%0, %1;	mfspr	%0, %1;	mfspr	%0, %1;	\
+			mfspr	%0, %1;	mfspr	%0, %1;	mfspr	%0, %1;"
+		    : "=r"(reg) : "K"(SPR_HID0), "r"(bsp_state));
+		__asm __volatile("ld %0, 8(%2); mtspr %1, %0; mtspr %1, %0; \
+		    isync" : "=r"(reg) : "K"(SPR_HID1), "r"(bsp_state));
+		__asm __volatile("ld %0, 16(%2); sync; mtspr %1, %0; isync;"
+		    : "=r"(reg) : "K"(SPR_HID4), "r"(bsp_state));
+		__asm __volatile("ld %0, 24(%2); sync; mtspr %1, %0; isync;"
+		    : "=r"(reg) : "K"(SPR_HID5), "r"(bsp_state));
+
+		powerpc_sync();
+		break;
+	case MPC7450:
+	case MPC7455:
+	case MPC7457:
+		/* Only MPC745x CPUs have an L3 cache. */
+		reg = mpc745x_l3_enable(bsp_state[3]);
+		
+		/* Fallthrough */
+	case MPC7400:
+	case MPC7410:
+	case MPC7447A:
+	case MPC7448:
+		/* XXX: Program the CPU ID into PIR */
+		__asm __volatile("mtspr 1023,%0" :: "r"(PCPU_GET(cpuid)));
+
+		powerpc_sync();
+		isync();
+
+		mtspr(SPR_HID0, bsp_state[0]); isync();
+		mtspr(SPR_HID1, bsp_state[1]); isync();
+
+		reg = mpc745x_l2_enable(bsp_state[2]);
+		reg = mpc745x_l1d_enable();
+		reg = mpc745x_l1i_enable();
+
+		break;
+	default:
+		printf("WARNING: Unknown CPU type. Cache performace may be "
+		    "suboptimal.\n");
+		break;
+	}
 }
 

Modified: head/sys/powerpc/aim/platform_chrp.c
==============================================================================
--- head/sys/powerpc/aim/platform_chrp.c	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/aim/platform_chrp.c	Fri Oct 23 03:17:02 2009	(r198378)
@@ -239,12 +239,14 @@ chrp_smp_start_cpu(platform_t plat, stru
 	rstvec = rstvec_virtbase + reset;
 
 	*rstvec = 4;
+	(void)(*rstvec);
 	powerpc_sync();
 	DELAY(1);
 	*rstvec = 0;
+	(void)(*rstvec);
 	powerpc_sync();
 
-	timeout = 1000;
+	timeout = 10000;
 	while (!pc->pc_awake && timeout--)
 		DELAY(100);
 

Modified: head/sys/powerpc/booke/mp_cpudep.c
==============================================================================
--- head/sys/powerpc/booke/mp_cpudep.c	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/booke/mp_cpudep.c	Fri Oct 23 03:17:02 2009	(r198378)
@@ -47,7 +47,7 @@ extern void icache_inval(void);
 
 volatile void *ap_pcpu;
 
-uint32_t
+uintptr_t
 cpudep_ap_bootstrap()
 {
 	uint32_t msr, sp, csr;
@@ -78,3 +78,8 @@ cpudep_ap_bootstrap()
 
 	return (sp);
 }
+
+void
+cpudep_ap_setup()
+{
+}

Modified: head/sys/powerpc/include/pcpu.h
==============================================================================
--- head/sys/powerpc/include/pcpu.h	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/include/pcpu.h	Fri Oct 23 03:17:02 2009	(r198378)
@@ -43,8 +43,8 @@ struct pmap;
 	struct thread	*pc_vecthread;		/* current vec user */  \
 	uintptr_t	pc_hwref;					\
 	uint32_t	pc_pir;						\
-	int		pc_bsp:1;					\
-	int		pc_awake:1;					\
+	int		pc_bsp;						\
+	volatile int	pc_awake;					\
 	uint32_t	pc_ipimask;					\
 	register_t	pc_tempsave[CPUSAVE_LEN];			\
 	register_t	pc_disisave[CPUSAVE_LEN];			\

Modified: head/sys/powerpc/include/smp.h
==============================================================================
--- head/sys/powerpc/include/smp.h	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/include/smp.h	Fri Oct 23 03:17:02 2009	(r198378)
@@ -48,7 +48,8 @@ struct cpuref {
 };
 
 void	pmap_cpu_bootstrap(int);
-uint32_t cpudep_ap_bootstrap(void);
+uintptr_t cpudep_ap_bootstrap(void);
+void	cpudep_ap_setup(void);
 void	machdep_ap_bootstrap(void);
 
 #endif /* !LOCORE */

Modified: head/sys/powerpc/include/spr.h
==============================================================================
--- head/sys/powerpc/include/spr.h	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/include/spr.h	Fri Oct 23 03:17:02 2009	(r198378)
@@ -50,7 +50,7 @@
 #define mtspr64(reg,valhi,vallo,scratch)				\
 	__asm __volatile("						\
 		mfmsr %0; 						\
-		insrdi %0,1,1,0; 					\
+		insrdi %0,%5,1,0; 					\
 		mtmsrd %0; 						\
 		isync; 							\
 									\
@@ -62,13 +62,13 @@
 		clrldi %0,%0,1; 					\
 		mtmsrd %0; 						\
 		isync;"							\
-	: "=r"(scratch), "=r"(valhi) : "r"(vallo), "K"(reg), "r"(32))
+	: "=r"(scratch), "=r"(valhi) : "r"(vallo), "K"(reg), "r"(32), "r"(1))
 
 #define mfspr64upper(reg,scratch)					\
 	( { register_t val;						\
 	    __asm __volatile("						\
 		mfmsr %0; 						\
-		insrdi %0,1,1,0; 					\
+		insrdi %0,%4,1,0; 					\
 		mtmsrd %0; 						\
 		isync; 							\
 									\
@@ -78,7 +78,7 @@
 		clrldi %0,%0,1; 					\
 		mtmsrd %0; 						\
 		isync;" 						\
-	    : "=r"(scratch), "=r"(val) : "K"(reg), "r"(32)); 			\
+	    : "=r"(scratch), "=r"(val) : "K"(reg), "r"(32), "r"(1));	\
 	    val; } )
 
 #endif /* _LOCORE */

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/powerpc/cpu.c	Fri Oct 23 03:17:02 2009	(r198378)
@@ -69,6 +69,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 int powerpc_pow_enabled;
@@ -112,9 +113,6 @@ static const struct cputab models[] = {
 static char model[64];
 SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, "");
 
-register_t	l2cr_config = 0;
-register_t	l3cr_config = 0;
-
 static void	cpu_print_speed(void);
 static void	cpu_print_cacheinfo(u_int, uint16_t);
 
@@ -258,11 +256,6 @@ cpu_setup(u_int cpuid)
 		case MPC7450:
 		case MPC7455:
 		case MPC7457:
-			/* Only MPC745x CPUs have an L3 cache. */
-
-			l3cr_config = mfspr(SPR_L3CR);
-
-			/* Fallthrough */
 		case MPC750:
 		case IBM750FX:
 		case MPC7400:
@@ -272,8 +265,6 @@ cpu_setup(u_int cpuid)
 			cpu_print_speed();
 			printf("\n");
 
-			l2cr_config = mfspr(SPR_L2CR);
-
 			if (bootverbose)
 				cpu_print_cacheinfo(cpuid, vers);
 			break;
@@ -366,15 +357,15 @@ cpu_print_cacheinfo(u_int cpuid, uint16_
 	printf("L1 D-cache %sabled\n", (hid & HID0_DCE) ? "en" : "dis");
 
 	printf("cpu%u: ", cpuid);
-  	if (l2cr_config & L2CR_L2E) {
+  	if (mfspr(SPR_L2CR) & L2CR_L2E) {
 		switch (vers) {
 		case MPC7450:
 		case MPC7455:
 		case MPC7457:
 			printf("256KB L2 cache, ");
-			if (l3cr_config & L3CR_L3E)
+			if (mfspr(SPR_L3CR) & L3CR_L3E)
 				printf("%cMB L3 backside cache",
-				    l3cr_config & L3CR_L3SIZ ? '2' : '1');
+				    mfspr(SPR_L3CR) & L3CR_L3SIZ ? '2' : '1');
 			else
 				printf("L3 cache disabled");
 			printf("\n");
@@ -383,7 +374,7 @@ cpu_print_cacheinfo(u_int cpuid, uint16_
 			printf("512KB L2 cache\n");
 			break; 
 		default:
-			switch (l2cr_config & L2CR_L2SIZ) {
+			switch (mfspr(SPR_L2CR) & L2CR_L2SIZ) {
 			case L2SIZ_256K:
 				printf("256KB ");
 				break;
@@ -394,9 +385,9 @@ cpu_print_cacheinfo(u_int cpuid, uint16_
 				printf("1MB ");
 				break;
 			}
-			printf("write-%s", (l2cr_config & L2CR_L2WT)
+			printf("write-%s", (mfspr(SPR_L2CR) & L2CR_L2WT)
 			    ? "through" : "back");
-			if (l2cr_config & L2CR_L2PE)
+			if (mfspr(SPR_L2CR) & L2CR_L2PE)
 				printf(", with parity");
 			printf(" backside cache\n");
 			break;

Modified: head/sys/powerpc/powerpc/mp_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/mp_machdep.c	Thu Oct 22 21:07:32 2009	(r198377)
+++ head/sys/powerpc/powerpc/mp_machdep.c	Fri Oct 23 03:17:02 2009	(r198378)
@@ -64,7 +64,10 @@ static u_int ipi_msg_cnt[32];
 void
 machdep_ap_bootstrap(void)
 {
+	/* Set up important bits on the CPU (HID registers, etc.) */
+	cpudep_ap_setup();
 
+	/* Set PIR */
 	PCPU_SET(pir, mfspr(SPR_PIR));
 	PCPU_SET(awake, 1);
 	__asm __volatile("msync; isync");
@@ -78,7 +81,7 @@ machdep_ap_bootstrap(void)
 	__asm __volatile("mtdec %0" :: "r"(ap_decr));
 
 	atomic_add_int(&ap_awake, 1);
-	CTR1(KTR_SMP, "SMP: AP CPU%d launched", PCPU_GET(cpuid));
+	printf("SMP: AP CPU #%d launched\n", PCPU_GET(cpuid));
 
 	/* Initialize curthread */
 	PCPU_SET(curthread, PCPU_GET(idlethread));
@@ -86,6 +89,8 @@ machdep_ap_bootstrap(void)
 
 	/* Let the DEC and external interrupts go */
 	mtmsr(mfmsr() | PSL_EE);
+
+	/* Announce ourselves awake, and enter the scheduler */
 	sched_throw(NULL);
 }
 
@@ -247,6 +252,9 @@ cpu_mp_unleash(void *dummy)
 		    mp_ncpus, cpus, smp_cpus);
 	}
 
+	/* Let the APs get into the scheduler */
+	DELAY(10000);
+
 	smp_active = 1;
 	smp_started = 1;
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 03:51:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 21B86106566B;
	Fri, 23 Oct 2009 03:51:33 +0000 (UTC)
	(envelope-from jhay@meraka.csir.co.za)
Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za
	[IPv6:2001:4200:7000:2::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 430D18FC0A;
	Fri, 23 Oct 2009 03:51:32 +0000 (UTC)
Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973)
	id 489B03982D; Fri, 23 Oct 2009 05:51:27 +0200 (SAST)
Date: Fri, 23 Oct 2009 05:51:27 +0200
From: John Hay 
To: Andrew Thompson 
Message-ID: <20091023035127.GA23683@zibbi.meraka.csir.co.za>
References: <200910222101.n9ML1fT9040071@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200910222101.n9ML1fT9040071@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198376 - head/lib/libusb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 03:51:33 -0000

Hi,

Any chance that we can get it into 8.0 too? This fix printing with
print/hplip3, which is probably what most people with multi-function
HP printers will use.

John
-- 
John Hay -- jhay@meraka.csir.co.za / jhay@FreeBSD.org

On Thu, Oct 22, 2009 at 09:01:41PM +0000, Andrew Thompson wrote:
> Author: thompsa
> Date: Thu Oct 22 21:01:41 2009
> New Revision: 198376
> URL: http://svn.freebsd.org/changeset/base/198376
> 
> Log:
>   Prevent wraparound of the timeout variable.
>   
>   Submitted by:	HPS
> 
> Modified:
>   head/lib/libusb/libusb20_ugen20.c
> 
> Modified: head/lib/libusb/libusb20_ugen20.c
> ==============================================================================
> --- head/lib/libusb/libusb20_ugen20.c	Thu Oct 22 20:59:51 2009	(r198375)
> +++ head/lib/libusb/libusb20_ugen20.c	Thu Oct 22 21:01:41 2009	(r198376)
> @@ -800,7 +800,11 @@ ugen20_tr_submit(struct libusb20_transfe
>  	if (xfer->flags & LIBUSB20_TRANSFER_DO_CLEAR_STALL) {
>  		fsep->flags |= USB_FS_FLAG_CLEAR_STALL;
>  	}
> -	fsep->timeout = xfer->timeout;
> +	/* NOTE: The "fsep->timeout" variable is 16-bit. */
> +	if (xfer->timeout > 65535)
> +		fsep->timeout = 65535;
> +	else
> +		fsep->timeout = xfer->timeout;
>  
>  	temp.ep_index = xfer->trIndex;
>  


From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 04:25:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 54A8F106566B;
	Fri, 23 Oct 2009 04:25:59 +0000 (UTC) (envelope-from xcllnt@mac.com)
Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E9F58FC15;
	Fri, 23 Oct 2009 04:25:59 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=us-ascii; format=flowed
Received: from macbook-pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67])
	by asmtp026.mac.com
	(Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008;
	32bit)) with ESMTPSA id <0KRY006AW9MOTN40@asmtp026.mac.com>; Thu,
	22 Oct 2009 21:25:38 -0700 (PDT)
From: Marcel Moolenaar 
In-reply-to: <200910230317.n9N3H2YP047516@svn.freebsd.org>
Date: Thu, 22 Oct 2009 21:25:36 -0700
Message-id: <5F64E59D-076C-416D-9761-C89C765EB7BA@mac.com>
References: <200910230317.n9N3H2YP047516@svn.freebsd.org>
To: Nathan Whitehorn 
X-Mailer: Apple Mail (2.1076)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198378 - in head/sys/powerpc: aim booke include
 powerpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 04:25:59 -0000


On Oct 22, 2009, at 8:17 PM, Nathan Whitehorn wrote:

> Author: nwhitehorn
> Date: Fri Oct 23 03:17:02 2009
> New Revision: 198378
> URL: http://svn.freebsd.org/changeset/base/198378
>
> Log:
>  Add SMP support on U3-based G5 systems.

Yay!

-- 
Marcel Moolenaar
xcllnt@mac.com




From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 07:54:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 07C72106566C;
	Fri, 23 Oct 2009 07:54:16 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EC06A8FC13;
	Fri, 23 Oct 2009 07:54:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9N7sF3s053120;
	Fri, 23 Oct 2009 07:54:15 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9N7sFtL053118;
	Fri, 23 Oct 2009 07:54:15 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910230754.n9N7sFtL053118@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 23 Oct 2009 07:54:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198381 - head/sys/cam/scsi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 07:54:16 -0000

Author: mav
Date: Fri Oct 23 07:54:15 2009
New Revision: 198381
URL: http://svn.freebsd.org/changeset/base/198381

Log:
  Remove some obsoleted comments.

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Oct 23 07:36:12 2009	(r198380)
+++ head/sys/cam/scsi/scsi_da.c	Fri Oct 23 07:54:15 2009	(r198381)
@@ -813,19 +813,6 @@ dastrategy(struct bio *bp)
 
 	cam_periph_lock(periph);
 
-#if 0
-	/*
-	 * check it's not too big a transfer for our adapter
-	 */
-	scsi_minphys(bp,&sd_switch);
-#endif
-
-	/*
-	 * Mask interrupts so that the pack cannot be invalidated until
-	 * after we are in the queue.  Otherwise, we might not properly
-	 * clean up one of the buffers.
-	 */
-	
 	/*
 	 * If the device has been made invalid, error out
 	 */

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 08:27:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81ECF106566C;
	Fri, 23 Oct 2009 08:27:55 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F73E8FC08;
	Fri, 23 Oct 2009 08:27:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9N8RtYs053890;
	Fri, 23 Oct 2009 08:27:55 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9N8RtgA053875;
	Fri, 23 Oct 2009 08:27:55 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910230827.n9N8RtgA053875@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 23 Oct 2009 08:27:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198382 - in head/sys/cam: . ata scsi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 08:27:55 -0000

Author: mav
Date: Fri Oct 23 08:27:55 2009
New Revision: 198382
URL: http://svn.freebsd.org/changeset/base/198382

Log:
  Replace most of priority numbers with defines. No logical changes.

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_xpt.c
  head/sys/cam/cam.h
  head/sys/cam/cam_periph.c
  head/sys/cam/cam_xpt.c
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_ch.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_pt.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/cam/scsi/scsi_targ_bh.c
  head/sys/cam/scsi/scsi_target.c
  head/sys/cam/scsi/scsi_xpt.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/ata/ata_da.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -270,7 +270,7 @@ adaclose(struct disk *dp)
 	/* We only sync the cache if the drive is capable of it. */
 	if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) {
 
-		ccb = cam_periph_getccb(periph, /*priority*/1);
+		ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 		cam_fill_ataio(&ccb->ataio,
 				    1,
 				    adadone,
@@ -343,7 +343,7 @@ adastrategy(struct bio *bp)
 	/*
 	 * Schedule ourselves for performing the work.
 	 */
-	xpt_schedule(periph, /* XXX priority */1);
+	xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 	cam_periph_unlock(periph);
 
 	return;
@@ -377,7 +377,7 @@ adadump(void *arg, void *virtual, vm_off
 
 	if (length > 0) {
 		periph->flags |= CAM_PERIPH_POLLED;
-		xpt_setup_ccb(&ccb.ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		ccb.ccb_h.ccb_state = ADA_CCB_DUMP;
 		cam_fill_ataio(&ccb.ataio,
 		    0,
@@ -408,7 +408,7 @@ adadump(void *arg, void *virtual, vm_off
 	}
 
 	if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) {
-		xpt_setup_ccb(&ccb.ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 
 		ccb.ccb_h.ccb_state = ADA_CCB_DUMP;
 		cam_fill_ataio(&ccb.ataio,
@@ -563,7 +563,7 @@ adaasync(void *callback_arg, u_int32_t c
 		 */
 		softc->state = ADA_STATE_SET_MULTI;
 		cam_periph_acquire(periph);
-		xpt_schedule(periph, 0);
+		xpt_schedule(periph, CAM_PRIORITY_DEV);
 		break;
 	}
 	default:
@@ -665,7 +665,7 @@ adaregister(struct cam_periph *periph, v
 
 	/* Check if the SIM does not want queued commands */
 	bzero(&cpi, sizeof(cpi));
-	xpt_setup_ccb(&cpi.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 	if (cpi.ccb_h.status != CAM_REQ_CMP ||
@@ -897,7 +897,7 @@ adastart(struct cam_periph *periph, unio
 		
 		if (bp != NULL) {
 			/* Have more work to do, so ensure we stay scheduled */
-			xpt_schedule(periph, /* XXX priority */1);
+			xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 		}
 		break;
 	}
@@ -1027,7 +1027,7 @@ adadone(struct cam_periph *periph, union
 		xpt_release_ccb(done_ccb);
 		if (bioq_first(&softc->bio_queue) != NULL) {
 			/* Have more work to do, so ensure we stay scheduled */
-			xpt_schedule(periph, 1);
+			xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 		}
 		cam_periph_release_locked(periph);
 		return;
@@ -1139,7 +1139,7 @@ adashutdown(void * arg, int howto)
 			continue;
 		}
 
-		xpt_setup_ccb(&ccb.ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 
 		ccb.ccb_h.ccb_state = ADA_CCB_DUMP;
 		cam_fill_ataio(&ccb.ataio,

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/ata/ata_xpt.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -270,7 +270,7 @@ probeschedule(struct cam_periph *periph)
 	softc = (probe_softc *)periph->softc;
 	ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs);
 
-	xpt_setup_ccb(&cpi.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
@@ -506,7 +506,7 @@ proberequestdefaultnegotiation(struct ca
 {
 	struct ccb_trans_settings cts;
 
-	xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_USER_SETTINGS;
 	xpt_action((union ccb *)&cts);
@@ -528,7 +528,7 @@ proberequestbackoff(struct cam_periph *p
 	struct ccb_trans_settings_spi *spi;
 
 	memset(&cts, 0, sizeof (cts));
-	xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_CURRENT_SETTINGS;
 	xpt_action((union ccb *)&cts);
@@ -655,7 +655,7 @@ probedone(struct cam_periph *periph, uni
 
 				/* Report SIM that PM is present. */
 				bzero(&cts, sizeof(cts));
-				xpt_setup_ccb(&cts.ccb_h, path, 1);
+				xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
 				cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
 				cts.type = CTS_TYPE_CURRENT_SETTINGS;
 				cts.xport_specific.sata.pm_present = 1;
@@ -1270,7 +1270,7 @@ ata_scan_lun(struct cam_periph *periph, 
 	CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE,
 		  ("xpt_scan_lun\n"));
 
-	xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
@@ -1308,7 +1308,7 @@ ata_scan_lun(struct cam_periph *periph, 
 			free(new_path, M_CAMXPT);
 			return;
 		}
-		xpt_setup_ccb(&request_ccb->ccb_h, new_path, /*priority*/ 1);
+		xpt_setup_ccb(&request_ccb->ccb_h, new_path, CAM_PRIORITY_NORMAL);
 		request_ccb->ccb_h.cbfcnp = xptscandone;
 		request_ccb->ccb_h.func_code = XPT_SCAN_LUN;
 		request_ccb->crcn.flags = flags;
@@ -1407,7 +1407,7 @@ ata_device_transport(struct cam_path *pa
 	struct ata_params *ident_buf = NULL;
 
 	/* Get transport information from the SIM */
-	xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
@@ -1427,7 +1427,7 @@ ata_device_transport(struct cam_path *pa
 	    ata_version(ident_buf->version_major) : cpi.transport_version;
 
 	/* Tell the controller what we think */
-	xpt_setup_ccb(&cts.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
 	cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_CURRENT_SETTINGS;
 	cts.transport = path->device->transport;
@@ -1555,7 +1555,7 @@ scsi_set_transfer_settings(struct ccb_tr
 
 	inq_data = &device->inq_data;
 	scsi = &cts->proto_specific.scsi;
-	xpt_setup_ccb(&cpi.ccb_h, cts->ccb_h.path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
@@ -1576,7 +1576,7 @@ scsi_set_transfer_settings(struct ccb_tr
 		 * Perform sanity checking against what the
 		 * controller and device can do.
 		 */
-		xpt_setup_ccb(&cur_cts.ccb_h, cts->ccb_h.path, /*priority*/1);
+		xpt_setup_ccb(&cur_cts.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NORMAL);
 		cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 		cur_cts.type = cts->type;
 		xpt_action((union ccb *)&cur_cts);
@@ -1636,7 +1636,7 @@ scsi_set_transfer_settings(struct ccb_tr
 				device->tag_delay_count = 0;
 
 				xpt_setup_ccb(&crs.ccb_h, cts->ccb_h.path,
-					      /*priority*/1);
+				    CAM_PRIORITY_NORMAL);
 				crs.ccb_h.func_code = XPT_REL_SIMQ;
 				crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY;
 				crs.openings
@@ -1669,7 +1669,7 @@ scsi_toggle_tags(struct cam_path *path)
  	  && (dev->inq_flags & (SID_Sync|SID_WBus16|SID_WBus32)) != 0)) {
 		struct ccb_trans_settings cts;
 
-		xpt_setup_ccb(&cts.ccb_h, path, 1);
+		xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
 		cts.protocol = PROTO_SCSI;
 		cts.protocol_version = PROTO_VERSION_UNSPECIFIED;
 		cts.transport = XPORT_UNSPECIFIED;

Modified: head/sys/cam/cam.h
==============================================================================
--- head/sys/cam/cam.h	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/cam.h	Fri Oct 23 08:27:55 2009	(r198382)
@@ -66,6 +66,8 @@ struct cam_periph;
  */
 typedef struct {
 	u_int32_t priority;
+#define CAM_PRIORITY_DEV	0
+#define CAM_PRIORITY_NORMAL	1
 #define CAM_PRIORITY_NONE	(u_int32_t)-1
 	u_int32_t generation;
 	int       index;

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/cam_periph.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -534,13 +534,13 @@ camperiphfree(struct cam_periph *periph)
 		switch (periph->deferred_ac) {
 		case AC_FOUND_DEVICE:
 			ccb.ccb_h.func_code = XPT_GDEV_TYPE;
-			xpt_setup_ccb(&ccb.ccb_h, periph->path, /*priority*/ 1);
+			xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 			xpt_action(&ccb);
 			arg = &ccb;
 			break;
 		case AC_PATH_REGISTERED:
 			ccb.ccb_h.func_code = XPT_PATH_INQ;
-			xpt_setup_ccb(&ccb.ccb_h, periph->path, /*priority*/ 1);
+			xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 			xpt_action(&ccb);
 			arg = &ccb;
 			break;
@@ -831,10 +831,10 @@ cam_periph_ioctl(struct cam_periph *peri
 
 	switch(cmd){
 	case CAMGETPASSTHRU:
-		ccb = cam_periph_getccb(periph, /* priority */ 1);
+		ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 		xpt_setup_ccb(&ccb->ccb_h,
 			      ccb->ccb_h.path,
-			      /*priority*/1);
+			      CAM_PRIORITY_NORMAL);
 		ccb->ccb_h.func_code = XPT_GDEVLIST;
 
 		/*
@@ -939,7 +939,7 @@ cam_freeze_devq(struct cam_path *path)
 {
 	struct ccb_hdr ccb_h;
 
-	xpt_setup_ccb(&ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&ccb_h, path, CAM_PRIORITY_NORMAL);
 	ccb_h.func_code = XPT_NOOP;
 	ccb_h.flags = CAM_DEV_QFREEZE;
 	xpt_action((union ccb *)&ccb_h);
@@ -952,8 +952,7 @@ cam_release_devq(struct cam_path *path, 
 {
 	struct ccb_relsim crs;
 
-	xpt_setup_ccb(&crs.ccb_h, path,
-		      /*priority*/1);
+	xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL);
 	crs.ccb_h.func_code = XPT_REL_SIMQ;
 	crs.ccb_h.flags = getcount_only ? CAM_DEV_QFREEZE : 0;
 	crs.release_flags = relsim_flags;
@@ -1070,7 +1069,7 @@ camperiphdone(struct cam_periph *periph,
 			 * Grab the inquiry data for this device.
 			 */
 			xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path,
-				      /*priority*/ 1);
+			    CAM_PRIORITY_NORMAL);
 			cgd.ccb_h.func_code = XPT_GDEV_TYPE;
 			xpt_action((union ccb *)&cgd);
 			err_action = scsi_error_action(&done_ccb->csio,
@@ -1212,7 +1211,7 @@ cam_periph_bus_settle(struct cam_periph 
 {
 	struct ccb_getdevstats cgds;
 
-	xpt_setup_ccb(&cgds.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cgds.ccb_h.func_code = XPT_GDEV_STATS;
 	xpt_action((union ccb *)&cgds);
 	cam_periph_freeze_after_event(periph, &cgds.last_reset, bus_settle);
@@ -1280,7 +1279,7 @@ camperiphscsistatuserror(union ccb *ccb,
 		 */
 		xpt_setup_ccb(&cgds.ccb_h,
 			      ccb->ccb_h.path,
-			      /*priority*/1);
+			      CAM_PRIORITY_NORMAL);
 		cgds.ccb_h.func_code = XPT_GDEV_STATS;
 		xpt_action((union ccb *)&cgds);
 
@@ -1403,7 +1402,7 @@ camperiphscsisenseerror(union ccb *ccb, 
 		/*
 		 * Grab the inquiry data for this device.
 		 */
-		xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, /*priority*/ 1);
+		xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL);
 		cgd.ccb_h.func_code = XPT_GDEV_TYPE;
 		xpt_action((union ccb *)&cgd);
 
@@ -1543,14 +1542,14 @@ camperiphscsisenseerror(union ccb *ccb, 
 		
 		if ((err_action & SS_MASK) >= SS_START) {
 			/*
-			 * Drop the priority to 0 so that the recovery
+			 * Drop the priority, so that the recovery
 			 * CCB is the first to execute.  Freeze the queue
 			 * after this command is sent so that we can
 			 * restore the old csio and have it queued in
 			 * the proper order before we release normal 
 			 * transactions to the device.
 			 */
-			ccb->ccb_h.pinfo.priority = 0;
+			ccb->ccb_h.pinfo.priority = CAM_PRIORITY_DEV;
 			ccb->ccb_h.flags |= CAM_DEV_QFREEZE;
 			ccb->ccb_h.saved_ccb_ptr = save_ccb;
 			error = ERESTART;

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/cam_xpt.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -812,7 +812,7 @@ xpt_scanner_thread(void *dummy)
 			else
 				ccb->ccb_h.func_code = XPT_SCAN_LUN;
 			ccb->ccb_h.cbfcnp = xptdone;
-			xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, 1);
+			xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, CAM_PRIORITY_BUS);
 			cam_periph_runccb(ccb, NULL, 0, 0, NULL);
 			xpt_free_path(ccb->ccb_h.path);
 			xpt_free_ccb(ccb);
@@ -1059,7 +1059,7 @@ xpt_announce_periph(struct cam_periph *p
 		printf("%s%d: Serial Number %.60s\n", periph->periph_name,
 		       periph->unit_number, path->device->serial_num);
 	}
-	xpt_setup_ccb(&cts.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
 	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_CURRENT_SETTINGS;
 	xpt_action((union ccb*)&cts);
@@ -1068,7 +1068,7 @@ xpt_announce_periph(struct cam_periph *p
 	}
 
 	/* Ask the SIM for its base transfer speed */
-	xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
@@ -2335,7 +2335,7 @@ xptsetasyncfunc(struct cam_ed *device, v
 			 device->target->bus->path_id,
 			 device->target->target_id,
 			 device->lun_id);
-	xpt_setup_ccb(&cgd.ccb_h, &path, /*priority*/1);
+	xpt_setup_ccb(&cgd.ccb_h, &path, CAM_PRIORITY_NORMAL);
 	cgd.ccb_h.func_code = XPT_GDEV_TYPE;
 	xpt_action((union ccb *)&cgd);
 	cur_entry->callback(cur_entry->callback_arg,
@@ -2359,7 +2359,7 @@ xptsetasyncbusfunc(struct cam_eb *bus, v
 			 bus->sim->path_id,
 			 CAM_TARGET_WILDCARD,
 			 CAM_LUN_WILDCARD);
-	xpt_setup_ccb(&cpi.ccb_h, &path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 	cur_entry->callback(cur_entry->callback_arg,
@@ -3799,7 +3799,7 @@ xpt_bus_register(struct cam_sim *sim, de
 	if (status != CAM_REQ_CMP)
 		printf("xpt_compile_path returned %d\n", status);
 
-	xpt_setup_ccb(&cpi.ccb_h, &path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
@@ -4544,7 +4544,7 @@ xpt_start_tags(struct cam_path *path)
 		newopenings = min(device->maxtags,
 				  sim->max_tagged_dev_openings);
 	xpt_dev_ccbq_resize(path, newopenings);
-	xpt_setup_ccb(&crs.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL);
 	crs.ccb_h.func_code = XPT_REL_SIMQ;
 	crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY;
 	crs.openings
@@ -4571,7 +4571,7 @@ xptconfigbuscountfunc(struct cam_eb *bus
 		busses_to_config++;
 		xpt_compile_path(&path, NULL, bus->path_id,
 				 CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
-		xpt_setup_ccb(&cpi.ccb_h, &path, /*priority*/1);
+		xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL);
 		cpi.ccb_h.func_code = XPT_PATH_INQ;
 		xpt_action((union ccb *)&cpi);
 		can_negotiate = cpi.hba_inquiry;
@@ -4614,7 +4614,7 @@ xptconfigfunc(struct cam_eb *bus, void *
 			xpt_finishconfig(xpt_periph, NULL);
 			return(0);
 		}
-		xpt_setup_ccb(&work_ccb->ccb_h, path, /*priority*/1);
+		xpt_setup_ccb(&work_ccb->ccb_h, path, CAM_PRIORITY_NORMAL);
 		work_ccb->ccb_h.func_code = XPT_PATH_INQ;
 		xpt_action(work_ccb);
 		if (work_ccb->ccb_h.status != CAM_REQ_CMP) {
@@ -4629,7 +4629,7 @@ xptconfigfunc(struct cam_eb *bus, void *
 		can_negotiate &= (PI_WIDE_32|PI_WIDE_16|PI_SDTR_ABLE);
 		if ((work_ccb->cpi.hba_misc & PIM_NOBUSRESET) == 0
 		 && (can_negotiate != 0)) {
-			xpt_setup_ccb(&work_ccb->ccb_h, path, /*priority*/1);
+			xpt_setup_ccb(&work_ccb->ccb_h, path, CAM_PRIORITY_NORMAL);
 			work_ccb->ccb_h.func_code = XPT_RESET_BUS;
 			work_ccb->ccb_h.cbfcnp = NULL;
 			CAM_DEBUG(path, CAM_DEBUG_SUBTRACE,

Modified: head/sys/cam/scsi/scsi_all.c
==============================================================================
--- head/sys/cam/scsi/scsi_all.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_all.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -3004,7 +3004,7 @@ scsi_command_string(struct cam_device *d
 	 */
 	xpt_setup_ccb(&cgd.ccb_h,
 		      csio->ccb_h.path,
-		      /*priority*/ 1);
+		      CAM_PRIORITY_NORMAL);
 	cgd.ccb_h.func_code = XPT_GDEV_TYPE;
 	xpt_action((union ccb *)&cgd);
 
@@ -3088,7 +3088,7 @@ scsi_sense_sbuf(struct cam_device *devic
 	 */
 	xpt_setup_ccb(&cgd.ccb_h,
 		      csio->ccb_h.path,
-		      /*priority*/ 1);
+		      CAM_PRIORITY_NORMAL);
 	cgd.ccb_h.func_code = XPT_GDEV_TYPE;
 	xpt_action((union ccb *)&cgd);
 

Modified: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_cd.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -673,7 +673,7 @@ cdregister(struct cam_periph *periph, vo
 		softc->quirks = CD_Q_NONE;
 
 	/* Check if the SIM does not want 6 byte commands */
-	xpt_setup_ccb(&cpi.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 	if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE))
@@ -1105,7 +1105,7 @@ cdschedule(struct cam_periph *periph, in
 		 * We don't do anything with the priority here.
 		 * This is strictly a fifo queue.
 		 */
-		softc->pinfo.priority = 1;
+		softc->pinfo.priority = CAM_PRIORITY_NORMAL;
 		softc->pinfo.generation = ++softc->changer->devq.generation;
 		camq_insert(&softc->changer->devq, (cam_pinfo *)softc);
 
@@ -1206,7 +1206,7 @@ cdrunchangerqueue(void *arg)
 
 	/* Just in case this device is waiting */
 	wakeup(&softc->changer);
-	xpt_schedule(softc->periph, /*priority*/ 1);
+	xpt_schedule(softc->periph, CAM_PRIORITY_NORMAL);
 
 	/*
 	 * Get rid of any pending timeouts, and set a flag to schedule new
@@ -1344,7 +1344,7 @@ cdgetccb(struct cam_periph *periph, u_in
 			 * If this changer isn't already queued, queue it up.
 			 */
 			if (softc->pinfo.index == CAM_UNQUEUED_INDEX) {
-				softc->pinfo.priority = 1;
+				softc->pinfo.priority = CAM_PRIORITY_NORMAL;
 				softc->pinfo.generation =
 					++softc->changer->devq.generation;
 				camq_insert(&softc->changer->devq,
@@ -1421,9 +1421,9 @@ cdstrategy(struct bio *bp)
 	 * differently for changers.
 	 */
 	if ((softc->flags & CD_FLAG_CHANGER) == 0)
-		xpt_schedule(periph, /* XXX priority */1);
+		xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 	else
-		cdschedule(periph, /* priority */ 1);
+		cdschedule(periph, CAM_PRIORITY_NORMAL);
 
 	cam_periph_unlock(periph);
 	return;
@@ -1493,7 +1493,7 @@ cdstart(struct cam_periph *periph, union
 		}
 		if (bp != NULL) {
 			/* Have more work to do, so ensure we stay scheduled */
-			xpt_schedule(periph, /* XXX priority */1);
+			xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 		}
 		break;
 	}
@@ -1668,7 +1668,7 @@ cddone(struct cam_periph *periph, union 
 
 				xpt_setup_ccb(&cgd.ccb_h, 
 					      done_ccb->ccb_h.path,
-					      /* priority */ 1);
+					      CAM_PRIORITY_NORMAL);
 				cgd.ccb_h.func_code = XPT_GDEV_TYPE;
 				xpt_action((union ccb *)&cgd);
 
@@ -2727,7 +2727,7 @@ cdprevent(struct cam_periph *periph, int
 		return;
 	}
 	    
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_prevent(&ccb->csio, 
 		     /*retries*/ 1,
@@ -2901,7 +2901,7 @@ cdsize(struct cam_periph *periph, u_int3
 
 	softc = (struct cd_softc *)periph->softc;
              
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	/* XXX Should be M_WAITOK */
 	rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), 
@@ -3153,7 +3153,7 @@ cdreadtoc(struct cam_periph *periph, u_i
 	ntoc = len;
 	error = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	csio = &ccb->csio;
 
@@ -3200,7 +3200,7 @@ cdreadsubchannel(struct cam_periph *peri
 
 	error = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	csio = &ccb->csio;
 
@@ -3252,7 +3252,7 @@ cdgetmode(struct cam_periph *periph, str
 
 	softc = (struct cd_softc *)periph->softc;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	csio = &ccb->csio;
 
@@ -3351,7 +3351,7 @@ cdsetmode(struct cam_periph *periph, str
 
 	softc = (struct cd_softc *)periph->softc;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	csio = &ccb->csio;
 
@@ -3443,7 +3443,7 @@ cdplay(struct cam_periph *periph, u_int3
 	u_int8_t cdb_len;
 
 	error = 0;
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 	csio = &ccb->csio;
 	/*
 	 * Use the smallest possible command to perform the operation.
@@ -3500,7 +3500,7 @@ cdplaymsf(struct cam_periph *periph, u_i
 
 	error = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	csio = &ccb->csio;
 
@@ -3546,7 +3546,7 @@ cdplaytracks(struct cam_periph *periph, 
 
 	error = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	csio = &ccb->csio;
 
@@ -3588,7 +3588,7 @@ cdpause(struct cam_periph *periph, u_int
 
 	error = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	csio = &ccb->csio;
 
@@ -3625,7 +3625,7 @@ cdstartunit(struct cam_periph *periph, i
 
 	error = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_start_stop(&ccb->csio,
 			/* retries */ 1,
@@ -3653,7 +3653,7 @@ cdstopunit(struct cam_periph *periph, u_
 
 	error = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_start_stop(&ccb->csio,
 			/* retries */ 1,
@@ -3682,7 +3682,7 @@ cdsetspeed(struct cam_periph *periph, u_
 	int error;
 
 	error = 0;
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 	csio = &ccb->csio;
 
 	/* Preserve old behavior: units in multiples of CDROM speed */
@@ -3730,7 +3730,7 @@ cdreportkey(struct cam_periph *periph, s
 	databuf = NULL;
 	lba = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	switch (authinfo->format) {
 	case DVD_REPORT_AGID:
@@ -3887,7 +3887,7 @@ cdsendkey(struct cam_periph *periph, str
 	error = 0;
 	databuf = NULL;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	switch(authinfo->format) {
 	case DVD_SEND_CHALLENGE: {
@@ -3983,7 +3983,7 @@ cdreaddvdstructure(struct cam_periph *pe
 	/* The address is reserved for many of the formats */
 	address = 0;
 
-	ccb = cdgetccb(periph, /* priority */ 1);
+	ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL);
 
 	switch(dvdstruct->format) {
 	case DVD_STRUCT_PHYSICAL:

Modified: head/sys/cam/scsi/scsi_ch.c
==============================================================================
--- head/sys/cam/scsi/scsi_ch.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_ch.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -809,7 +809,7 @@ chmove(struct cam_periph *periph, struct
 	fromelem = softc->sc_firsts[cm->cm_fromtype] + cm->cm_fromunit;
 	toelem = softc->sc_firsts[cm->cm_totype] + cm->cm_tounit;
 
-	ccb = cam_periph_getccb(periph, /*priority*/ 1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_move_medium(&ccb->csio,
 			 /* retries */ 1,
@@ -868,7 +868,7 @@ chexchange(struct cam_periph *periph, st
 	dst1 = softc->sc_firsts[ce->ce_fdsttype] + ce->ce_fdstunit;
 	dst2 = softc->sc_firsts[ce->ce_sdsttype] + ce->ce_sdstunit;
 
-	ccb = cam_periph_getccb(periph, /*priority*/ 1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_exchange_medium(&ccb->csio,
 			     /* retries */ 1,
@@ -918,7 +918,7 @@ chposition(struct cam_periph *periph, st
 	 */
 	dst = softc->sc_firsts[cp->cp_type] + cp->cp_unit;
 
-	ccb = cam_periph_getccb(periph, /*priority*/ 1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_position_to_element(&ccb->csio,
 				 /* retries */ 1,
@@ -1075,7 +1075,7 @@ chgetelemstatus(struct cam_periph *perip
 	data = (caddr_t)malloc(1024, M_DEVBUF, M_WAITOK);
 
 	cam_periph_lock(periph);
-	ccb = cam_periph_getccb(periph, /*priority*/ 1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_read_element_status(&ccb->csio,
 				 /* retries */ 1,
@@ -1201,7 +1201,7 @@ chielem(struct cam_periph *periph,
 	error = 0;
 	softc = (struct ch_softc *)periph->softc;
 
-	ccb = cam_periph_getccb(periph, /*priority*/ 1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_initialize_element_status(&ccb->csio,
 				      /* retries */ 1,
@@ -1285,7 +1285,7 @@ chsetvoltag(struct cam_periph *periph,
 	       min(strlen(csvr->csvr_voltag.cv_volid), sizeof(ssvtp.vitf)));
 	scsi_ulto2b(csvr->csvr_voltag.cv_serial, ssvtp.minvsn);
 
-	ccb = cam_periph_getccb(periph, /*priority*/ 1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_send_volume_tag(&ccb->csio,
 			     /* retries */ 1,
@@ -1323,7 +1323,7 @@ chgetparams(struct cam_periph *periph)
 
 	softc = (struct ch_softc *)periph->softc;
 
-	ccb = cam_periph_getccb(periph, /*priority*/ 1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 	/*
 	 * The scsi_mode_sense_data structure is just a convenience

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_da.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -729,7 +729,7 @@ daclose(struct disk *dp)
 	if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) {
 		union	ccb *ccb;
 
-		ccb = cam_periph_getccb(periph, /*priority*/1);
+		ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 		scsi_synchronize_cache(&ccb->csio,
 				       /*retries*/1,
@@ -830,7 +830,7 @@ dastrategy(struct bio *bp)
 	/*
 	 * Schedule ourselves for performing the work.
 	 */
-	xpt_schedule(periph, /* XXX priority */1);
+	xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 	cam_periph_unlock(periph);
 
 	return;
@@ -860,7 +860,7 @@ dadump(void *arg, void *virtual, vm_offs
 
 	if (length > 0) {
 		periph->flags |= CAM_PERIPH_POLLED;
-		xpt_setup_ccb(&csio.ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&csio.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		csio.ccb_h.ccb_state = DA_CCB_DUMP;
 		scsi_read_write(&csio,
 				/*retries*/1,
@@ -897,7 +897,7 @@ dadump(void *arg, void *virtual, vm_offs
 	 */
 	if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) {
 
-		xpt_setup_ccb(&csio.ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&csio.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		csio.ccb_h.ccb_state = DA_CCB_DUMP;
 		scsi_synchronize_cache(&csio,
 				       /*retries*/1,
@@ -1194,7 +1194,7 @@ daregister(struct cam_periph *periph, vo
 
 	/* Check if the SIM does not want 6 byte commands */
 	bzero(&cpi, sizeof(cpi));
-	xpt_setup_ccb(&cpi.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 	if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE))
@@ -1381,7 +1381,7 @@ dastart(struct cam_periph *periph, union
 		
 		if (bp != NULL) {
 			/* Have more work to do, so ensure we stay scheduled */
-			xpt_schedule(periph, /* XXX priority */1);
+			xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 		}
 		break;
 	}
@@ -1678,7 +1678,7 @@ dadone(struct cam_periph *periph, union 
 
 				xpt_setup_ccb(&cgd.ccb_h, 
 					      done_ccb->ccb_h.path,
-					      /* priority */ 1);
+					      CAM_PRIORITY_NORMAL);
 				cgd.ccb_h.func_code = XPT_GDEV_TYPE;
 				xpt_action((union ccb *)&cgd);
 
@@ -1832,7 +1832,7 @@ daprevent(struct cam_periph *periph, int
 		return;
 	}
 
-	ccb = cam_periph_getccb(periph, /*priority*/1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
 	scsi_prevent(&ccb->csio,
 		     /*retries*/1,
@@ -1882,7 +1882,7 @@ dagetcapacity(struct cam_periph *periph)
 	if (rcap == NULL)
 		return (ENOMEM);
 		
-	ccb = cam_periph_getccb(periph, /*priority*/1);
+	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 	scsi_read_capacity(&ccb->csio,
 			   /*retries*/4,
 			   /*cbfncp*/dadone,
@@ -1976,7 +1976,7 @@ dasetgeom(struct cam_periph *periph, uin
 	 * up with something that will make this a bootable
 	 * device.
 	 */
-	xpt_setup_ccb(&ccg.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&ccg.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	ccg.ccb_h.func_code = XPT_CALC_GEOMETRY;
 	ccg.block_size = dp->secsize;
 	ccg.volume_size = dp->sectors;
@@ -2050,7 +2050,7 @@ dashutdown(void * arg, int howto)
 			continue;
 		}
 
-		xpt_setup_ccb(&ccb.ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 
 		ccb.ccb_h.ccb_state = DA_CCB_DUMP;
 		scsi_synchronize_cache(&ccb.csio,

Modified: head/sys/cam/scsi/scsi_pt.c
==============================================================================
--- head/sys/cam/scsi/scsi_pt.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_pt.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -224,7 +224,7 @@ ptstrategy(struct bio *bp)
 	/*
 	 * Schedule ourselves for performing the work.
 	 */
-	xpt_schedule(periph, /* XXX priority */1);
+	xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 	cam_periph_unlock(periph);
 
 	return;
@@ -464,7 +464,7 @@ ptstart(struct cam_periph *periph, union
 		
 		if (bp != NULL) {
 			/* Have more work to do, so ensure we stay scheduled */
-			xpt_schedule(periph, /* XXX priority */1);
+			xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 		}
 	}
 }

Modified: head/sys/cam/scsi/scsi_sa.c
==============================================================================
--- head/sys/cam/scsi/scsi_sa.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_sa.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -786,7 +786,7 @@ sastrategy(struct bio *bp)
 	/*
 	 * Schedule ourselves for performing the work.
 	 */
-	xpt_schedule(periph, 1);
+	xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 	cam_periph_unlock(periph);
 
 	return;
@@ -1689,7 +1689,7 @@ again:
 		
 		if (bp != NULL) {
 			/* Have more work to do, so ensure we stay scheduled */
-			xpt_schedule(periph, 1);
+			xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 		}
 		break;
 	}

Modified: head/sys/cam/scsi/scsi_targ_bh.c
==============================================================================
--- head/sys/cam/scsi/scsi_targ_bh.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_targ_bh.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -240,7 +240,7 @@ targbhenlun(struct cam_periph *periph)
 	if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) != 0)
 		return (CAM_REQ_CMP);
 
-	xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	immed_ccb.ccb_h.func_code = XPT_EN_LUN;
 
 	/* Don't need support for any vendor specific commands */
@@ -280,7 +280,7 @@ targbhenlun(struct cam_periph *periph)
 			break;
 		}
 
-		xpt_setup_ccb(&atio->ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&atio->ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		atio->ccb_h.func_code = XPT_ACCEPT_TARGET_IO;
 		atio->ccb_h.cbfcnp = targbhdone;
 		xpt_action((union ccb *)atio);
@@ -318,7 +318,7 @@ targbhenlun(struct cam_periph *periph)
 			break;
 		}
 
-		xpt_setup_ccb(&inot->ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&inot->ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		inot->ccb_h.func_code = XPT_IMMED_NOTIFY;
 		inot->ccb_h.cbfcnp = targbhdone;
 		xpt_action((union ccb *)inot);
@@ -361,7 +361,7 @@ targbhdislun(struct cam_periph *periph)
 		
 		softc->accept_tio_list =
 		    ((struct targbh_cmd_desc*)atio->ccb_h.ccb_descr)->atio_link;
-		xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		ccb.cab.ccb_h.func_code = XPT_ABORT;
 		ccb.cab.abort_ccb = (union ccb *)atio;
 		xpt_action(&ccb);
@@ -369,7 +369,7 @@ targbhdislun(struct cam_periph *periph)
 
 	while ((ccb_h = SLIST_FIRST(&softc->immed_notify_slist)) != NULL) {
 		SLIST_REMOVE_HEAD(&softc->immed_notify_slist, periph_links.sle);
-		xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, /*priority*/1);
+		xpt_setup_ccb(&ccb.cab.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 		ccb.cab.ccb_h.func_code = XPT_ABORT;
 		ccb.cab.abort_ccb = (union ccb *)ccb_h;
 		xpt_action(&ccb);
@@ -378,7 +378,7 @@ targbhdislun(struct cam_periph *periph)
 	/*
 	 * Dissable this lun.
 	 */
-	xpt_setup_ccb(&ccb.cel.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&ccb.cel.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	ccb.cel.ccb_h.func_code = XPT_EN_LUN;
 	ccb.cel.enable = 0;
 	xpt_action(&ccb);
@@ -528,7 +528,7 @@ targbhstart(struct cam_periph *periph, u
 		ccbh = TAILQ_FIRST(&softc->work_queue);
 	}
 	if (ccbh != NULL)
-		xpt_schedule(periph, /*priority*/1);
+		xpt_schedule(periph, CAM_PRIORITY_NORMAL);
 }
 
 static void
@@ -647,7 +647,7 @@ targbhdone(struct cam_periph *periph, un
 		} else {
 			TAILQ_INSERT_TAIL(&softc->work_queue, &atio->ccb_h,
 					  periph_links.tqe);
-			priority = 1;
+			priority = CAM_PRIORITY_NORMAL;
 		}
 		xpt_schedule(periph, priority);
 		break;

Modified: head/sys/cam/scsi/scsi_target.c
==============================================================================
--- head/sys/cam/scsi/scsi_target.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_target.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -319,7 +319,7 @@ targioctl(struct cdev *dev, u_long cmd, 
 		else
 			cdbg.flags = CAM_DEBUG_NONE;
 		cam_periph_lock(softc->periph);
-		xpt_setup_ccb(&cdbg.ccb_h, softc->path, /*priority*/0);
+		xpt_setup_ccb(&cdbg.ccb_h, softc->path, CAM_PRIORITY_NORMAL);
 		cdbg.ccb_h.func_code = XPT_DEBUG;
 		cdbg.ccb_h.cbfcnp = targdone;
 
@@ -410,7 +410,7 @@ targendislun(struct cam_path *path, int 
 	cam_status	  status;
 
 	/* Tell the lun to begin answering selects */
-	xpt_setup_ccb(&en_ccb.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&en_ccb.ccb_h, path, CAM_PRIORITY_NORMAL);
 	en_ccb.ccb_h.func_code = XPT_EN_LUN;
 	/* Don't need support for any vendor specific commands */
 	en_ccb.grp6_len = grp6_len;
@@ -438,7 +438,7 @@ targenable(struct targ_softc *softc, str
 		return (CAM_LUN_ALRDY_ENA);
 
 	/* Make sure SIM supports target mode */
-	xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 	status = cpi.ccb_h.status & CAM_STATUS_MASK;
@@ -586,7 +586,7 @@ targwrite(struct cdev *dev, struct uio *
 			break;
 		}
 		priority = fuword32(&user_ccb->ccb_h.pinfo.priority);
-		if (priority == -1) {
+		if (priority == CAM_PRIORITY_NONE) {
 			error = EINVAL;
 			break;
 		}
@@ -1100,7 +1100,7 @@ abort_all_pending(struct targ_softc *sof
 	 * Then abort all pending CCBs.
 	 * targdone() will return the aborted CCB via user_ccb_queue
 	 */
-	xpt_setup_ccb(&cab.ccb_h, softc->path, /*priority*/0);
+	xpt_setup_ccb(&cab.ccb_h, softc->path, CAM_PRIORITY_NORMAL);
 	cab.ccb_h.func_code = XPT_ABORT;
 	cab.ccb_h.status = CAM_REQ_CMP_ERR;
 	TAILQ_FOREACH(ccb_h, &softc->pending_ccb_queue, periph_links.tqe) {

Modified: head/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- head/sys/cam/scsi/scsi_xpt.c	Fri Oct 23 07:54:15 2009	(r198381)
+++ head/sys/cam/scsi/scsi_xpt.c	Fri Oct 23 08:27:55 2009	(r198382)
@@ -629,7 +629,7 @@ probeschedule(struct cam_periph *periph)
 	softc = (probe_softc *)periph->softc;
 	ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs);
 
-	xpt_setup_ccb(&cpi.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
@@ -880,7 +880,7 @@ proberequestdefaultnegotiation(struct ca
 {
 	struct ccb_trans_settings cts;
 
-	xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_USER_SETTINGS;
 	xpt_action((union ccb *)&cts);
@@ -902,7 +902,7 @@ proberequestbackoff(struct cam_periph *p
 	struct ccb_trans_settings_spi *spi;
 
 	memset(&cts, 0, sizeof (cts));
-	xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1);
+	xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 	cts.type = CTS_TYPE_CURRENT_SETTINGS;
 	xpt_action((union ccb *)&cts);
@@ -1748,7 +1748,7 @@ scsi_scan_lun(struct cam_periph *periph,
 	CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE,
 		  ("scsi_scan_lun\n"));
 
-	xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
+	xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
@@ -1798,7 +1798,7 @@ scsi_scan_lun(struct cam_periph *periph,
 			free(new_path, M_CAMXPT);
 			return;
 		}

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 09:30:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D438B1065676;
	Fri, 23 Oct 2009 09:30:19 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C3B1E8FC15;
	Fri, 23 Oct 2009 09:30:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9N9UJRD055179;
	Fri, 23 Oct 2009 09:30:19 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9N9UJw9055177;
	Fri, 23 Oct 2009 09:30:19 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <200910230930.n9N9UJw9055177@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 23 Oct 2009 09:30:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198383 - head/etc/rc.d
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 09:30:19 -0000

Author: hrs
Date: Fri Oct 23 09:30:19 2009
New Revision: 198383
URL: http://svn.freebsd.org/changeset/base/198383

Log:
  Use double-quotation marks to fix the unexpanded variable issue.
  
  Spotted by:	swell.k

Modified:
  head/etc/rc.d/netoptions

Modified: head/etc/rc.d/netoptions
==============================================================================
--- head/etc/rc.d/netoptions	Fri Oct 23 08:27:55 2009	(r198382)
+++ head/etc/rc.d/netoptions	Fri Oct 23 09:30:19 2009	(r198383)
@@ -53,7 +53,7 @@ netoptions_inet()
 		${SYSCTL_W} net.inet.tcp.rfc1323=1 >/dev/null
 	else
 		netoptions_init
-		echo -n ' rfc1323 extensions=${tcp_extensions}'
+		echo -n " rfc1323 extensions=${tcp_extensions}"
 		${SYSCTL_W} net.inet.tcp.rfc1323=0 >/dev/null
 	fi
 
@@ -61,13 +61,13 @@ netoptions_inet()
 		${SYSCTL_W} net.inet.tcp.always_keepalive=1 >/dev/null
 	else
 		netoptions_init
-		echo -n ' TCP keepalive=${tcp_keepalive}'
+		echo -n " TCP keepalive=${tcp_keepalive}"
 		${SYSCTL_W} net.inet.tcp.always_keepalive=0 >/dev/null
 	fi
 
 	if checkyesno tcp_drop_synfin; then
 		netoptions_init
-		echo -n ' drop SYN+FIN packets=${tcp_drop_synfin}'
+		echo -n " drop SYN+FIN packets=${tcp_drop_synfin}"
 		${SYSCTL_W} net.inet.tcp.drop_synfin=1 >/dev/null
 	else
 		${SYSCTL_W} net.inet.tcp.drop_synfin=0 >/dev/null

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 11:13:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 01E95106566B;
	Fri, 23 Oct 2009 11:13:09 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E53138FC08;
	Fri, 23 Oct 2009 11:13:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NBD8FT058870;
	Fri, 23 Oct 2009 11:13:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NBD8gI058868;
	Fri, 23 Oct 2009 11:13:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910231113.n9NBD8gI058868@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 23 Oct 2009 11:13:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198384 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 11:13:09 -0000

Author: rpaulo
Date: Fri Oct 23 11:13:08 2009
New Revision: 198384
URL: http://svn.freebsd.org/changeset/base/198384

Log:
  The draft spec doesn't say beacon frames need to have a wildcard BSSID,
  so remove the mesh code necessary for that.
  
  MFC after:	2 days

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Fri Oct 23 09:30:19 2009	(r198383)
+++ head/sys/net80211/ieee80211_output.c	Fri Oct 23 11:13:08 2009	(r198384)
@@ -2764,13 +2764,7 @@ ieee80211_beacon_alloc(struct ieee80211_
 	*(uint16_t *)wh->i_dur = 0;
 	IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr);
 	IEEE80211_ADDR_COPY(wh->i_addr2, vap->iv_myaddr);
-#ifdef IEEE80211_SUPPORT_MESH
-	if (vap->iv_opmode == IEEE80211_M_MBSS) {
-		static const uint8_t zerobssid[IEEE80211_ADDR_LEN];
-		IEEE80211_ADDR_COPY(wh->i_addr3, zerobssid);
-	} else
-#endif
-		IEEE80211_ADDR_COPY(wh->i_addr3, ni->ni_bssid);
+	IEEE80211_ADDR_COPY(wh->i_addr3, ni->ni_bssid);
 	*(uint16_t *)wh->i_seq = 0;
 
 	return m;

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 11:26:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D9021065676;
	Fri, 23 Oct 2009 11:26:58 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5CC668FC18;
	Fri, 23 Oct 2009 11:26:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NBQwLj059197;
	Fri, 23 Oct 2009 11:26:58 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NBQwLf059195;
	Fri, 23 Oct 2009 11:26:58 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910231126.n9NBQwLf059195@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 23 Oct 2009 11:26:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198385 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 11:26:58 -0000

Author: mav
Date: Fri Oct 23 11:26:58 2009
New Revision: 198385
URL: http://svn.freebsd.org/changeset/base/198385

Log:
  Fix the build.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Fri Oct 23 11:13:08 2009	(r198384)
+++ head/sys/cam/cam_xpt.c	Fri Oct 23 11:26:58 2009	(r198385)
@@ -812,7 +812,7 @@ xpt_scanner_thread(void *dummy)
 			else
 				ccb->ccb_h.func_code = XPT_SCAN_LUN;
 			ccb->ccb_h.cbfcnp = xptdone;
-			xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, CAM_PRIORITY_BUS);
+			xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL);
 			cam_periph_runccb(ccb, NULL, 0, 0, NULL);
 			xpt_free_path(ccb->ccb_h.path);
 			xpt_free_ccb(ccb);

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 12:36:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31979106566B;
	Fri, 23 Oct 2009 12:36:43 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E9A98FC14;
	Fri, 23 Oct 2009 12:36:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NCahUN060709;
	Fri, 23 Oct 2009 12:36:43 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NCagTt060705;
	Fri, 23 Oct 2009 12:36:42 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910231236.n9NCagTt060705@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 23 Oct 2009 12:36:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198389 - in head/sys: cam/ata conf modules/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 12:36:43 -0000

Author: mav
Date: Fri Oct 23 12:36:42 2009
New Revision: 198389
URL: http://svn.freebsd.org/changeset/base/198389

Log:
  MFp4:
  Move Port Multiplier support code out of ATA XPT into pmp periph driver.
  This is convinient, as PMP itself is a bus target and has own state.

Added:
  head/sys/cam/ata/ata_pmp.c   (contents, props changed)
Modified:
  head/sys/cam/ata/ata_xpt.c
  head/sys/conf/files
  head/sys/modules/cam/Makefile

Added: head/sys/cam/ata/ata_pmp.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/cam/ata/ata_pmp.c	Fri Oct 23 12:36:42 2009	(r198389)
@@ -0,0 +1,735 @@
+/*-
+ * Copyright (c) 2009 Alexander Motin 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer,
+ *    without modification, immediately at the beginning of the file.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+
+#ifdef _KERNEL
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#endif /* _KERNEL */
+
+#ifndef _KERNEL
+#include 
+#include 
+#endif /* _KERNEL */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#ifdef _KERNEL
+
+typedef enum {
+	PMP_STATE_NORMAL,
+	PMP_STATE_PORTS,
+	PMP_STATE_CONFIG,
+	PMP_STATE_RESET,
+	PMP_STATE_CONNECT,
+	PMP_STATE_CHECK,
+	PMP_STATE_CLEAR,
+	PMP_STATE_SCAN
+} pmp_state;
+
+typedef enum {
+	PMP_FLAG_SCTX_INIT	= 0x200
+} pmp_flags;
+
+typedef enum {
+	PMP_CCB_PROBE		= 0x01,
+} pmp_ccb_state;
+
+/* Offsets into our private area for storing information */
+#define ccb_state	ppriv_field0
+#define ccb_bp		ppriv_ptr1
+
+struct pmp_softc {
+	SLIST_ENTRY(pmp_softc)	links;
+	pmp_state		state;
+	pmp_flags		flags;
+	uint32_t		pm_pid;
+	uint32_t		pm_prv;
+	int			pm_ports;
+	int			pm_step;
+	int			pm_try;
+	int			found;
+	int			frozen;
+	union			ccb saved_ccb;
+	struct task		sysctl_task;
+	struct sysctl_ctx_list	sysctl_ctx;
+	struct sysctl_oid	*sysctl_tree;
+};
+
+static	periph_init_t	pmpinit;
+static	void		pmpasync(void *callback_arg, u_int32_t code,
+				struct cam_path *path, void *arg);
+static	void		pmpsysctlinit(void *context, int pending);
+static	periph_ctor_t	pmpregister;
+static	periph_dtor_t	pmpcleanup;
+static	periph_start_t	pmpstart;
+static	periph_oninv_t	pmponinvalidate;
+static	void		pmpdone(struct cam_periph *periph,
+			       union ccb *done_ccb);
+
+#ifndef PMP_DEFAULT_TIMEOUT
+#define PMP_DEFAULT_TIMEOUT 30	/* Timeout in seconds */
+#endif
+
+#ifndef	PMP_DEFAULT_RETRY
+#define	PMP_DEFAULT_RETRY	1
+#endif
+
+static int pmp_retry_count = PMP_DEFAULT_RETRY;
+static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT;
+
+SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0,
+            "CAM Direct Access Disk driver");
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RW,
+           &pmp_retry_count, 0, "Normal I/O retry count");
+TUNABLE_INT("kern.cam.pmp.retry_count", &pmp_retry_count);
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW,
+           &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)");
+TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout);
+
+static struct periph_driver pmpdriver =
+{
+	pmpinit, "pmp",
+	TAILQ_HEAD_INITIALIZER(pmpdriver.units), /* generation */ 0
+};
+
+PERIPHDRIVER_DECLARE(pmp, pmpdriver);
+
+MALLOC_DEFINE(M_ATPMP, "ata_pmp", "ata_pmp buffers");
+
+static void
+pmpinit(void)
+{
+	cam_status status;
+
+	/*
+	 * Install a global async callback.  This callback will
+	 * receive async callbacks like "new device found".
+	 */
+	status = xpt_register_async(AC_FOUND_DEVICE, pmpasync, NULL, NULL);
+
+	if (status != CAM_REQ_CMP) {
+		printf("pmp: Failed to attach master async callback "
+		       "due to status 0x%x!\n", status);
+	}
+}
+
+static void
+pmpfreeze(struct cam_periph *periph, int mask)
+{
+	struct pmp_softc *softc = (struct pmp_softc *)periph->softc;
+	struct cam_path *dpath;
+	int i;
+
+	mask &= ~softc->frozen;
+	for (i = 0; i < 15; i++) {
+		if ((mask & (1 << i)) == 0)
+			continue;
+		if (xpt_create_path(&dpath, periph,
+		    xpt_path_path_id(periph->path),
+		    i, 0) == CAM_REQ_CMP) {
+printf("PMP freeze: %d\n", i);
+			softc->frozen |= (1 << i);
+			cam_freeze_devq(dpath);
+			xpt_free_path(dpath);
+		}
+	}
+}
+
+static void
+pmprelease(struct cam_periph *periph, int mask)
+{
+	struct pmp_softc *softc = (struct pmp_softc *)periph->softc;
+	struct cam_path *dpath;
+	int i;
+
+	mask &= softc->frozen;
+	for (i = 0; i < 15; i++) {
+		if ((mask & (1 << i)) == 0)
+			continue;
+		if (xpt_create_path(&dpath, periph,
+		    xpt_path_path_id(periph->path),
+		    i, 0) == CAM_REQ_CMP) {
+printf("PMP release: %d\n", i);
+			softc->frozen &= ~(1 << i);
+			cam_release_devq(dpath, 0, 0, 0, FALSE);
+			xpt_free_path(dpath);
+		}
+	}
+}
+
+static void
+pmponinvalidate(struct cam_periph *periph)
+{
+	struct pmp_softc *softc;
+	struct cam_path *dpath;
+	int i;
+
+	softc = (struct pmp_softc *)periph->softc;
+
+	/*
+	 * De-register any async callbacks.
+	 */
+	xpt_register_async(0, pmpasync, periph, periph->path);
+
+	for (i = 0; i < 15; i++) {
+		if (xpt_create_path(&dpath, periph,
+		    xpt_path_path_id(periph->path),
+		    i, 0) == CAM_REQ_CMP) {
+			xpt_async(AC_LOST_DEVICE, dpath, NULL);
+			xpt_free_path(dpath);
+		}
+	}
+	xpt_print(periph->path, "lost device\n");
+}
+
+static void
+pmpcleanup(struct cam_periph *periph)
+{
+	struct pmp_softc *softc;
+
+	softc = (struct pmp_softc *)periph->softc;
+
+	xpt_print(periph->path, "removing device entry\n");
+	cam_periph_unlock(periph);
+
+	/*
+	 * If we can't free the sysctl tree, oh well...
+	 */
+	if ((softc->flags & PMP_FLAG_SCTX_INIT) != 0
+	    && sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
+		xpt_print(periph->path, "can't remove sysctl context\n");
+	}
+
+	free(softc, M_DEVBUF);
+	cam_periph_lock(periph);
+}
+
+static void
+pmpasync(void *callback_arg, u_int32_t code,
+	struct cam_path *path, void *arg)
+{
+	struct cam_periph *periph;
+	struct pmp_softc *softc;
+
+	periph = (struct cam_periph *)callback_arg;
+	switch (code) {
+	case AC_FOUND_DEVICE:
+	{
+		struct ccb_getdev *cgd;
+		cam_status status;
+ 
+		cgd = (struct ccb_getdev *)arg;
+		if (cgd == NULL)
+			break;
+
+		if (cgd->protocol != PROTO_SATAPM)
+			break;
+
+		/*
+		 * Allocate a peripheral instance for
+		 * this device and start the probe
+		 * process.
+		 */
+		status = cam_periph_alloc(pmpregister, pmponinvalidate,
+					  pmpcleanup, pmpstart,
+					  "pmp", CAM_PERIPH_BIO,
+					  cgd->ccb_h.path, pmpasync,
+					  AC_FOUND_DEVICE, cgd);
+
+		if (status != CAM_REQ_CMP
+		 && status != CAM_REQ_INPROG)
+			printf("pmpasync: Unable to attach to new device "
+				"due to status 0x%x\n", status);
+		break;
+	}
+	case AC_SCSI_AEN:
+	case AC_SENT_BDR:
+	case AC_BUS_RESET:
+		softc = (struct pmp_softc *)periph->softc;
+		cam_periph_async(periph, code, path, arg);
+		if (softc->state != PMP_STATE_NORMAL)
+			break;
+		pmpfreeze(periph, softc->found);
+		if (code == AC_SENT_BDR || code == AC_BUS_RESET)
+			softc->found = 0; /* We have to reset everything. */
+		softc->state = PMP_STATE_PORTS;
+		cam_periph_acquire(periph);
+		xpt_schedule(periph, CAM_PRIORITY_DEV);
+		break;
+	default:
+		cam_periph_async(periph, code, path, arg);
+		break;
+	}
+}
+
+static void
+pmpsysctlinit(void *context, int pending)
+{
+	struct cam_periph *periph;
+	struct pmp_softc *softc;
+	char tmpstr[80], tmpstr2[80];
+
+	periph = (struct cam_periph *)context;
+	if (cam_periph_acquire(periph) != CAM_REQ_CMP)
+		return;
+
+	softc = (struct pmp_softc *)periph->softc;
+	snprintf(tmpstr, sizeof(tmpstr), "CAM PMP unit %d", periph->unit_number);
+	snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
+
+	sysctl_ctx_init(&softc->sysctl_ctx);
+	softc->flags |= PMP_FLAG_SCTX_INIT;
+	softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
+		SYSCTL_STATIC_CHILDREN(_kern_cam_pmp), OID_AUTO, tmpstr2,
+		CTLFLAG_RD, 0, tmpstr);
+	if (softc->sysctl_tree == NULL) {
+		printf("pmpsysctlinit: unable to allocate sysctl tree\n");
+		cam_periph_release(periph);
+		return;
+	}
+
+	cam_periph_release(periph);
+}
+
+static cam_status
+pmpregister(struct cam_periph *periph, void *arg)
+{
+	struct pmp_softc *softc;
+	struct ccb_pathinq cpi;
+	struct ccb_getdev *cgd;
+
+	cgd = (struct ccb_getdev *)arg;
+	if (periph == NULL) {
+		printf("pmpregister: periph was NULL!!\n");
+		return(CAM_REQ_CMP_ERR);
+	}
+
+	if (cgd == NULL) {
+		printf("pmpregister: no getdev CCB, can't register device\n");
+		return(CAM_REQ_CMP_ERR);
+	}
+
+	softc = (struct pmp_softc *)malloc(sizeof(*softc), M_DEVBUF,
+	    M_NOWAIT|M_ZERO);
+
+	if (softc == NULL) {
+		printf("pmpregister: Unable to probe new device. "
+		       "Unable to allocate softc\n");				
+		return(CAM_REQ_CMP_ERR);
+	}
+	periph->softc = softc;
+
+	softc->state = PMP_STATE_PORTS;
+	softc->pm_pid = ((uint32_t *)&cgd->ident_data)[0];
+	softc->pm_prv = ((uint32_t *)&cgd->ident_data)[1];
+
+	/* Check if the SIM does not want queued commands */
+	bzero(&cpi, sizeof(cpi));
+	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
+	cpi.ccb_h.func_code = XPT_PATH_INQ;
+	xpt_action((union ccb *)&cpi);
+
+	TASK_INIT(&softc->sysctl_task, 0, pmpsysctlinit, periph);
+
+	xpt_announce_periph(periph, NULL);
+
+	/*
+	 * Add async callbacks for bus reset and
+	 * bus device reset calls.  I don't bother
+	 * checking if this fails as, in most cases,
+	 * the system will function just fine without
+	 * them and the only alternative would be to
+	 * not attach the device on failure.
+	 */
+	xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE |
+		AC_SCSI_AEN, pmpasync, periph, periph->path);
+
+	/*
+	 * Take an exclusive refcount on the periph while pmpstart is called
+	 * to finish the probe.  The reference will be dropped in pmpdone at
+	 * the end of probe.
+	 */
+	(void)cam_periph_acquire(periph);
+	xpt_schedule(periph, CAM_PRIORITY_DEV);
+
+	return(CAM_REQ_CMP);
+}
+
+static void
+pmpstart(struct cam_periph *periph, union ccb *start_ccb)
+{
+	struct ccb_ataio *ataio;
+	struct pmp_softc *softc;
+
+	softc = (struct pmp_softc *)periph->softc;
+	ataio = &start_ccb->ataio;
+
+	switch (softc->state) {
+	case PMP_STATE_PORTS:
+		cam_fill_ataio(ataio,
+		      pmp_retry_count,
+		      pmpdone,
+		      /*flags*/CAM_DIR_NONE,
+		      0,
+		      /*data_ptr*/NULL,
+		      /*dxfer_len*/0,
+		      pmp_default_timeout * 1000);
+		ata_pm_read_cmd(ataio, 2, 15);
+		break;
+	case PMP_STATE_CONFIG:
+		cam_fill_ataio(ataio,
+		      pmp_retry_count,
+		      pmpdone,
+		      /*flags*/CAM_DIR_NONE,
+		      0,
+		      /*data_ptr*/NULL,
+		      /*dxfer_len*/0,
+		      pmp_default_timeout * 1000);
+		ata_pm_write_cmd(ataio, 0x60, 15, 0xf);
+		break;
+	case PMP_STATE_RESET:
+		cam_fill_ataio(ataio,
+		      pmp_retry_count,
+		      pmpdone,
+		      /*flags*/CAM_DIR_NONE,
+		      0,
+		      /*data_ptr*/NULL,
+		      /*dxfer_len*/0,
+		      pmp_default_timeout * 1000);
+		ata_pm_write_cmd(ataio, 2, softc->pm_step,
+		    (softc->found & (1 << softc->pm_step)) ? 0 : 1);
+printf("PM RESET %d%s\n", softc->pm_step,
+    (softc->found & (1 << softc->pm_step)) ? " skipping" : "");
+		break;
+	case PMP_STATE_CONNECT:
+		cam_fill_ataio(ataio,
+		      pmp_retry_count,
+		      pmpdone,
+		      /*flags*/CAM_DIR_NONE,
+		      0,
+		      /*data_ptr*/NULL,
+		      /*dxfer_len*/0,
+		      pmp_default_timeout * 1000);
+		ata_pm_write_cmd(ataio, 2, softc->pm_step, 0);
+		break;
+	case PMP_STATE_CHECK:
+		cam_fill_ataio(ataio,
+		      pmp_retry_count,
+		      pmpdone,
+		      /*flags*/CAM_DIR_NONE,
+		      0,
+		      /*data_ptr*/NULL,
+		      /*dxfer_len*/0,
+		      pmp_default_timeout * 1000);
+		ata_pm_read_cmd(ataio, 0, softc->pm_step);
+		break;
+	case PMP_STATE_CLEAR:
+		cam_fill_ataio(ataio,
+		      pmp_retry_count,
+		      pmpdone,
+		      /*flags*/CAM_DIR_NONE,
+		      0,
+		      /*data_ptr*/NULL,
+		      /*dxfer_len*/0,
+		      pmp_default_timeout * 1000);
+		ata_pm_write_cmd(ataio, 1, softc->pm_step, 0xFFFFFFFF);
+		break;
+	default:
+		break;
+	}
+	xpt_action(start_ccb);
+}
+
+static void
+pmpdone(struct cam_periph *periph, union ccb *done_ccb)
+{
+	struct pmp_softc *softc;
+	struct ccb_ataio *ataio;
+	union ccb *work_ccb;
+	struct cam_path *path, *dpath;
+	u_int32_t  priority;
+
+	softc = (struct pmp_softc *)periph->softc;
+	ataio = &done_ccb->ataio;
+
+	CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("pmpdone\n"));
+
+	path = done_ccb->ccb_h.path;
+	priority = done_ccb->ccb_h.pinfo.priority;
+
+	switch (softc->state) {
+	case PMP_STATE_PORTS:
+		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+			softc->pm_ports = (done_ccb->ataio.res.lba_high << 24) +
+			    (done_ccb->ataio.res.lba_mid << 16) +
+			    (done_ccb->ataio.res.lba_low << 8) +
+			    done_ccb->ataio.res.sector_count;
+			/* This PM declares 6 ports, while only 5 of them are real.
+			 * Port 5 is enclosure management bridge port, which has implementation
+			 * problems, causing probe faults. Hide it for now. */
+			if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6)
+				softc->pm_ports = 5;
+			/* This PM declares 7 ports, while only 5 of them are real.
+			 * Port 5 is some fake "Config  Disk" with 640 sectors size,
+			 * port 6 is enclosure management bridge port.
+			 * Both fake ports has implementation problems, causing
+			 * probe faults. Hide them for now. */
+			if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7)
+				softc->pm_ports = 5;
+			printf("PM ports: %d\n", softc->pm_ports);
+			softc->state = PMP_STATE_CONFIG;
+			xpt_release_ccb(done_ccb);
+			xpt_schedule(periph, priority);
+			return;
+		} else if (cam_periph_error(done_ccb, 0, 0,
+					    &softc->saved_ccb) == ERESTART) {
+			return;
+		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+				cam_release_devq(done_ccb->ccb_h.path,
+						 /*relsim_flags*/0,
+						 /*reduction*/0,
+						 /*timeout*/0,
+						 /*getcount_only*/0);
+		}
+		xpt_release_ccb(done_ccb);
+		break;
+	case PMP_STATE_CONFIG:
+		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+			softc->pm_step = 0;
+			softc->state = PMP_STATE_RESET;
+			xpt_release_ccb(done_ccb);
+			xpt_schedule(periph, priority);
+			return;
+		} else if (cam_periph_error(done_ccb, 0, 0,
+					    &softc->saved_ccb) == ERESTART) {
+			return;
+		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+				cam_release_devq(done_ccb->ccb_h.path,
+						 /*relsim_flags*/0,
+						 /*reduction*/0,
+						 /*timeout*/0,
+						 /*getcount_only*/0);
+		}
+		xpt_release_ccb(done_ccb);
+		break;
+	case PMP_STATE_RESET:
+		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+			softc->pm_step++;
+			if (softc->pm_step < softc->pm_ports) {
+				xpt_release_ccb(done_ccb);
+				xpt_schedule(periph, priority);
+				return;
+			} else {
+				softc->pm_step = 0;
+				DELAY(5000);
+				printf("PM reset done\n");
+				softc->state = PMP_STATE_CONNECT;
+				xpt_release_ccb(done_ccb);
+				xpt_schedule(periph, priority);
+				return;
+			}
+		} else if (cam_periph_error(done_ccb, 0, 0,
+					    &softc->saved_ccb) == ERESTART) {
+			return;
+		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+				cam_release_devq(done_ccb->ccb_h.path,
+						 /*relsim_flags*/0,
+						 /*reduction*/0,
+						 /*timeout*/0,
+						 /*getcount_only*/0);
+		}
+		xpt_release_ccb(done_ccb);
+		break;
+	case PMP_STATE_CONNECT:
+		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+			softc->pm_step++;
+			if (softc->pm_step < softc->pm_ports) {
+				xpt_release_ccb(done_ccb);
+				xpt_schedule(periph, priority);
+				return;
+			} else {
+				softc->pm_step = 0;
+				softc->pm_try = 0;
+				printf("PM connect done\n");
+				softc->state = PMP_STATE_CHECK;
+				xpt_release_ccb(done_ccb);
+				xpt_schedule(periph, priority);
+				return;
+			}
+		} else if (cam_periph_error(done_ccb, 0, 0,
+					    &softc->saved_ccb) == ERESTART) {
+			return;
+		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+				cam_release_devq(done_ccb->ccb_h.path,
+						 /*relsim_flags*/0,
+						 /*reduction*/0,
+						 /*timeout*/0,
+						 /*getcount_only*/0);
+		}
+		xpt_release_ccb(done_ccb);
+		break;
+	case PMP_STATE_CHECK:
+		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+			int res = (done_ccb->ataio.res.lba_high << 24) +
+			    (done_ccb->ataio.res.lba_mid << 16) +
+			    (done_ccb->ataio.res.lba_low << 8) +
+			    done_ccb->ataio.res.sector_count;
+			if ((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) {
+				printf("PM status: %d - %08x\n", softc->pm_step, res);
+				softc->found |= (1 << softc->pm_step);
+				softc->pm_step++;
+			} else {
+				if (softc->pm_try < 100) {
+					DELAY(10000);
+					softc->pm_try++;
+				} else {
+					printf("PM status: %d - %08x\n", softc->pm_step, res);
+					softc->found &= ~(1 << softc->pm_step);
+					if (xpt_create_path(&dpath, periph,
+					    done_ccb->ccb_h.path_id,
+					    softc->pm_step, 0) == CAM_REQ_CMP) {
+						xpt_async(AC_LOST_DEVICE, dpath, NULL);
+						xpt_free_path(dpath);
+					}
+					softc->pm_step++;
+				}
+			}
+			if (softc->pm_step < softc->pm_ports) {
+				xpt_release_ccb(done_ccb);
+				xpt_schedule(periph, priority);
+				return;
+			} else {
+				softc->pm_step = 0;
+				softc->state = PMP_STATE_CLEAR;
+				xpt_release_ccb(done_ccb);
+				xpt_schedule(periph, priority);
+				return;
+			}
+		} else if (cam_periph_error(done_ccb, 0, 0,
+					    &softc->saved_ccb) == ERESTART) {
+			return;
+		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+				cam_release_devq(done_ccb->ccb_h.path,
+						 /*relsim_flags*/0,
+						 /*reduction*/0,
+						 /*timeout*/0,
+						 /*getcount_only*/0);
+		}
+		xpt_release_ccb(done_ccb);
+		break;
+	case PMP_STATE_CLEAR:
+		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+			softc->pm_step++;
+			if (softc->pm_step < softc->pm_ports) {
+				xpt_release_ccb(done_ccb);
+				xpt_schedule(periph, priority);
+				return;
+			} else if (softc->found) {
+				softc->pm_step = 0;
+				softc->state = PMP_STATE_SCAN;
+				work_ccb = xpt_alloc_ccb_nowait();
+				if (work_ccb != NULL)
+					goto do_scan;
+				xpt_release_ccb(done_ccb);
+			}
+			break;
+		} else if (cam_periph_error(done_ccb, 0, 0,
+					    &softc->saved_ccb) == ERESTART) {
+			return;
+		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+				cam_release_devq(done_ccb->ccb_h.path,
+						 /*relsim_flags*/0,
+						 /*reduction*/0,
+						 /*timeout*/0,
+						 /*getcount_only*/0);
+		}
+		xpt_release_ccb(done_ccb);
+		break;
+	case PMP_STATE_SCAN:
+		work_ccb = done_ccb;
+		done_ccb = (union ccb*)work_ccb->ccb_h.ppriv_ptr0;
+		/* Free the current request path- we're done with it. */
+		xpt_free_path(work_ccb->ccb_h.path);
+		softc->pm_step++;
+do_scan:
+		while (softc->pm_step < softc->pm_ports &&
+		    (softc->found & (1 << softc->pm_step)) == 0) {
+			softc->pm_step++;
+		}
+		if (softc->pm_step >= softc->pm_ports) {
+			xpt_free_ccb(work_ccb);
+			xpt_release_ccb(done_ccb);
+			break;
+		}
+		if (xpt_create_path(&dpath, periph,
+		    done_ccb->ccb_h.path_id,
+		    softc->pm_step, 0) != CAM_REQ_CMP) {
+			printf("pmpdone: xpt_create_path failed"
+			    ", bus scan halted\n");
+			xpt_free_ccb(work_ccb);
+			xpt_release_ccb(done_ccb);
+			break;
+		}
+		xpt_setup_ccb(&work_ccb->ccb_h, dpath,
+		    done_ccb->ccb_h.pinfo.priority);
+		work_ccb->ccb_h.func_code = XPT_SCAN_LUN;
+		work_ccb->ccb_h.cbfcnp = pmpdone;
+		work_ccb->ccb_h.ppriv_ptr0 = done_ccb;
+		work_ccb->crcn.flags = done_ccb->crcn.flags;
+		xpt_action(work_ccb);
+		pmprelease(periph, 1 << softc->pm_step);
+		return;
+	default:
+		break;
+	}
+	softc->state = PMP_STATE_NORMAL;
+	pmprelease(periph, -1);
+	cam_periph_release_locked(periph);
+}
+
+#endif /* _KERNEL */

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c	Fri Oct 23 12:29:45 2009	(r198388)
+++ head/sys/cam/ata/ata_xpt.c	Fri Oct 23 12:36:42 2009	(r198389)
@@ -96,11 +96,6 @@ typedef enum {
 	PROBE_FULL_INQUIRY,
 	PROBE_PM_PID,
 	PROBE_PM_PRV,
-	PROBE_PM_PORTS,
-	PROBE_PM_RESET,
-	PROBE_PM_CONNECT,
-	PROBE_PM_CHECK,
-	PROBE_PM_CLEAR,
 	PROBE_INVALID
 } probe_action;
 
@@ -112,11 +107,6 @@ static char *probe_action_text[] = {
 	"PROBE_FULL_INQUIRY",
 	"PROBE_PM_PID",
 	"PROBE_PM_PRV",
-	"PROBE_PM_PORTS",
-	"PROBE_PM_RESET",
-	"PROBE_PM_CONNECT",
-	"PROBE_PM_CHECK",
-	"PROBE_PM_CLEAR",
 	"PROBE_INVALID"
 };
 
@@ -142,9 +132,6 @@ typedef struct {
 	u_int8_t	digest[16];
 	uint32_t	pm_pid;
 	uint32_t	pm_prv;
-	int		pm_ports;
-	int		pm_step;
-	int		pm_try;
 	struct cam_periph *periph;
 } probe_softc;
 
@@ -274,10 +261,9 @@ probeschedule(struct cam_periph *periph)
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
 	xpt_action((union ccb *)&cpi);
 
-	if (periph->path->device->flags & CAM_DEV_UNCONFIGURED)
+	if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) ||
+	    periph->path->device->protocol == PROTO_SATAPM)
 		PROBE_SET_ACTION(softc, PROBE_RESET);
-	else if (periph->path->device->protocol == PROTO_SATAPM)
-		PROBE_SET_ACTION(softc, PROBE_PM_PID);
 	else
 		PROBE_SET_ACTION(softc, PROBE_IDENTIFY);
 
@@ -295,7 +281,6 @@ probestart(struct cam_periph *periph, un
 	/* Probe the device that our peripheral driver points to */
 	struct ccb_ataio *ataio;
 	struct ccb_scsiio *csio;
-	struct ccb_trans_settings cts;
 	probe_softc *softc;
 
 	CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probestart\n"));
@@ -306,21 +291,11 @@ probestart(struct cam_periph *periph, un
 
 	switch (softc->action) {
 	case PROBE_RESET:
-		if (start_ccb->ccb_h.target_id == 15) {
-			/* Report SIM that we have no knowledge about PM presence. */
-			bzero(&cts, sizeof(cts));
-			xpt_setup_ccb(&cts.ccb_h, start_ccb->ccb_h.path, 1);
-			cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
-			cts.type = CTS_TYPE_CURRENT_SETTINGS;
-			cts.xport_specific.sata.pm_present = 0;
-			cts.xport_specific.sata.valid = CTS_SATA_VALID_PM;
-			xpt_action((union ccb *)&cts);
-		}
 		cam_fill_ataio(ataio,
 		      0,
 		      probedone,
 		      /*flags*/CAM_DIR_NONE,
-		      MSG_SIMPLE_Q_TAG,
+		      0,
 		      /*data_ptr*/NULL,
 		      /*dxfer_len*/0,
 		      (start_ccb->ccb_h.target_id == 15 ? 3 : 15) * 1000);
@@ -351,7 +326,7 @@ probestart(struct cam_periph *periph, un
 		      1,
 		      probedone,
 		      /*flags*/CAM_DIR_IN,
-		      MSG_SIMPLE_Q_TAG,
+		      0,
 		      /*data_ptr*/(u_int8_t *)ident_buf,
 		      /*dxfer_len*/sizeof(struct ata_params),
 		      30 * 1000);
@@ -413,7 +388,7 @@ probestart(struct cam_periph *periph, un
 		      1,
 		      probedone,
 		      /*flags*/CAM_DIR_NONE,
-		      MSG_SIMPLE_Q_TAG,
+		      0,
 		      /*data_ptr*/NULL,
 		      /*dxfer_len*/0,
 		      10 * 1000);
@@ -424,74 +399,12 @@ probestart(struct cam_periph *periph, un
 		      1,
 		      probedone,
 		      /*flags*/CAM_DIR_NONE,
-		      MSG_SIMPLE_Q_TAG,
+		      0,
 		      /*data_ptr*/NULL,
 		      /*dxfer_len*/0,
 		      10 * 1000);
 		ata_pm_read_cmd(ataio, 1, 15);
 		break;
-	case PROBE_PM_PORTS:
-		cam_fill_ataio(ataio,
-		      1,
-		      probedone,
-		      /*flags*/CAM_DIR_NONE,
-		      MSG_SIMPLE_Q_TAG,
-		      /*data_ptr*/NULL,
-		      /*dxfer_len*/0,
-		      10 * 1000);
-		ata_pm_read_cmd(ataio, 2, 15);
-		break;
-	case PROBE_PM_RESET:
-	{
-		struct ata_params *ident_buf =
-		    &periph->path->device->ident_data;
-		cam_fill_ataio(ataio,
-		      1,
-		      probedone,
-		      /*flags*/CAM_DIR_NONE,
-		      MSG_SIMPLE_Q_TAG,
-		      /*data_ptr*/NULL,
-		      /*dxfer_len*/0,
-		      10 * 1000);
-		ata_pm_write_cmd(ataio, 2, softc->pm_step,
-		    (ident_buf->cylinders & (1 << softc->pm_step)) ? 0 : 1);
-printf("PM RESET %d %04x %d\n", softc->pm_step, ident_buf->cylinders,
-    (ident_buf->cylinders & (1 << softc->pm_step)) ? 0 : 1);
-		break;
-	}
-	case PROBE_PM_CONNECT:
-		cam_fill_ataio(ataio,
-		      1,
-		      probedone,
-		      /*flags*/CAM_DIR_NONE,
-		      MSG_SIMPLE_Q_TAG,
-		      /*data_ptr*/NULL,
-		      /*dxfer_len*/0,
-		      10 * 1000);
-		ata_pm_write_cmd(ataio, 2, softc->pm_step, 0);
-		break;
-	case PROBE_PM_CHECK:
-		cam_fill_ataio(ataio,
-		      1,
-		      probedone,
-		      /*flags*/CAM_DIR_NONE,
-		      MSG_SIMPLE_Q_TAG,
-		      /*data_ptr*/NULL,
-		      /*dxfer_len*/0,
-		      10 * 1000);
-		ata_pm_read_cmd(ataio, 0, softc->pm_step);
-		break;
-	case PROBE_PM_CLEAR:
-		cam_fill_ataio(ataio,
-		      1,
-		      probedone,
-		      /*flags*/CAM_DIR_NONE,
-		      MSG_SIMPLE_Q_TAG,
-		      /*data_ptr*/NULL,
-		      /*dxfer_len*/0,
-		      10 * 1000);
-		ata_pm_write_cmd(ataio, 1, softc->pm_step, 0xFFFFFFFF);
-		break;
 	case PROBE_INVALID:
 		CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO,
 		    ("probestart: invalid action state\n"));
@@ -630,7 +543,7 @@ probedone(struct cam_periph *periph, uni
 	probe_softc *softc;
 	struct cam_path *path;
 	u_int32_t  priority;
-	int found = 0;
+	int found = 1;
 
 	CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n"));
 
@@ -672,8 +585,7 @@ probedone(struct cam_periph *periph, uni
 					xpt_print(path,
 					    "Unexpected signature 0x%04x\n", sign);
 				}
-				xpt_release_ccb(done_ccb);
-				break;
+				goto device_fail;
 			}
 			xpt_release_ccb(done_ccb);
 			xpt_schedule(periph, priority);
@@ -780,9 +692,8 @@ device_fail:
 		 * drivers that this device is no more.
 		 */
 		if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0)
-			/* Send the async notification. */
 			xpt_async(AC_LOST_DEVICE, path, NULL);
-
+		found = 0;
 		xpt_release_ccb(done_ccb);
 		break;
 	}
@@ -881,6 +792,7 @@ modedone:		if (path->device->protocol ==
 			    (done_ccb->ataio.res.lba_mid << 16) +
 			    (done_ccb->ataio.res.lba_low << 8) +
 			    done_ccb->ataio.res.sector_count;
+			((uint32_t *)ident_buf)[0] = softc->pm_pid;
 			printf("PM Product ID: %08x\n", softc->pm_pid);
 			snprintf(ident_buf->model, sizeof(ident_buf->model),
 			    "Port Multiplier %08x", softc->pm_pid);
@@ -903,164 +815,24 @@ modedone:		if (path->device->protocol ==
 			    (done_ccb->ataio.res.lba_mid << 16) +
 			    (done_ccb->ataio.res.lba_low << 8) +
 			    done_ccb->ataio.res.sector_count;
+			((uint32_t *)ident_buf)[1] = softc->pm_prv;
 			printf("PM Revision: %08x\n", softc->pm_prv);
 			snprintf(ident_buf->revision, sizeof(ident_buf->revision),
 			    "%04x", softc->pm_prv);
-			PROBE_SET_ACTION(softc, PROBE_PM_PORTS);
-			xpt_release_ccb(done_ccb);
-			xpt_schedule(periph, priority);
-			return;
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
-			return;
-		} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
-			/* Don't wedge the queue */
-			xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
-					 /*run_queue*/TRUE);
-		}
-		goto device_fail;
-	case PROBE_PM_PORTS:
-		if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
-			softc->pm_ports = (done_ccb->ataio.res.lba_high << 24) +
-			    (done_ccb->ataio.res.lba_mid << 16) +
-			    (done_ccb->ataio.res.lba_low << 8) +
-			    done_ccb->ataio.res.sector_count;
-			/* This PM declares 6 ports, while only 5 of them are real.
-			 * Port 5 is enclosure management bridge port, which has implementation
-			 * problems, causing probe faults. Hide it for now. */
-			if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6)
-				softc->pm_ports = 5;
-			/* This PM declares 7 ports, while only 5 of them are real.
-			 * Port 5 is some fake "Config  Disk" with 640 sectors size,
-			 * port 6 is enclosure management bridge port.
-			 * Both fake ports has implementation problems, causing
-			 * probe faults. Hide them for now. */
-			if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7)
-				softc->pm_ports = 5;
-			printf("PM ports: %d\n", softc->pm_ports);
-			ident_buf->config = softc->pm_ports;
 			path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID;
-			softc->pm_step = 0;
-			PROBE_SET_ACTION(softc, PROBE_PM_RESET);
-			xpt_release_ccb(done_ccb);
-			xpt_schedule(periph, priority);
-			return;
-		} else if (cam_periph_error(done_ccb, 0, 0,
-					    &softc->saved_ccb) == ERESTART) {
-			return;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 13:07:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE3D4106568B;
	Fri, 23 Oct 2009 13:07:22 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D6B08FC0C;
	Fri, 23 Oct 2009 13:07:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9ND7MTu061301;
	Fri, 23 Oct 2009 13:07:22 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ND7MdA061299;
	Fri, 23 Oct 2009 13:07:22 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910231307.n9ND7MdA061299@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 23 Oct 2009 13:07:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198390 - head/sys/dev/ahci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 13:07:22 -0000

Author: mav
Date: Fri Oct 23 13:07:22 2009
New Revision: 198390
URL: http://svn.freebsd.org/changeset/base/198390

Log:
  Revert interrupt reason check order back.
  ATAPI errors may set IF bit together with TFE.

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Fri Oct 23 12:36:42 2009	(r198389)
+++ head/sys/dev/ahci/ahci.c	Fri Oct 23 13:07:22 2009	(r198390)
@@ -1001,12 +1001,7 @@ ahci_ch_intr(void *data)
 			/* XXX: reqests in loading state. */
 			if (((err >> i) & 1) == 0)
 				continue;
-			if (istatus & AHCI_P_IX_IF) {
-				if (ch->numtslots == 0 && i != ccs)
-					et = AHCI_ERR_INNOCENT;
-				else
-					et = AHCI_ERR_SATA;
-			} else if (istatus & AHCI_P_IX_TFE) {
+			if (istatus & AHCI_P_IX_TFE) {
 				/* Task File Error */
 				if (ch->numtslots == 0) {
 					/* Untagged operation. */
@@ -1019,6 +1014,11 @@ ahci_ch_intr(void *data)
 					et = AHCI_ERR_NCQ;
 					ncq_err = 1;
 				}
+			} else if (istatus & AHCI_P_IX_IF) {
+				if (ch->numtslots == 0 && i != ccs)
+					et = AHCI_ERR_INNOCENT;
+				else
+					et = AHCI_ERR_SATA;
 			} else
 				et = AHCI_ERR_INVALID;
 			ahci_end_transaction(&ch->slot[i], et);

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 13:28:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B64F610656AB;
	Fri, 23 Oct 2009 13:28:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A34238FC22;
	Fri, 23 Oct 2009 13:28:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NDSXnk061749;
	Fri, 23 Oct 2009 13:28:33 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NDSXKl061747;
	Fri, 23 Oct 2009 13:28:33 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910231328.n9NDSXKl061747@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Oct 2009 13:28:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198391 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 13:28:33 -0000

Author: jhb
Date: Fri Oct 23 13:28:33 2009
New Revision: 198391
URL: http://svn.freebsd.org/changeset/base/198391

Log:
  Properly sort the intr_event_describe_handler() prototype.
  
  Submitted by:	bde

Modified:
  head/sys/sys/interrupt.h

Modified: head/sys/sys/interrupt.h
==============================================================================
--- head/sys/sys/interrupt.h	Fri Oct 23 13:07:22 2009	(r198390)
+++ head/sys/sys/interrupt.h	Fri Oct 23 13:28:33 2009	(r198391)
@@ -168,12 +168,12 @@ int	intr_event_create(struct intr_event 
 	    void (*post_ithread)(void *), void (*post_filter)(void *),
 	    int (*assign_cpu)(void *, u_char), const char *fmt, ...)
 	    __printflike(9, 10);
+int	intr_event_describe_handler(struct intr_event *ie, void *cookie,
+	    const char *descr);
 int	intr_event_destroy(struct intr_event *ie);
 void	intr_event_execute_handlers(struct proc *p, struct intr_event *ie);
 int	intr_event_handle(struct intr_event *ie, struct trapframe *frame);
 int	intr_event_remove_handler(void *cookie);
-int	intr_event_describe_handler(struct intr_event *ie, void *cookie,
-	    const char *descr);
 int	intr_getaffinity(int irq, void *mask);
 void	*intr_handler_source(void *cookie);
 int	intr_setaffinity(int irq, void *mask);

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 13:35:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D6041065695;
	Fri, 23 Oct 2009 13:35:01 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C09F8FC17;
	Fri, 23 Oct 2009 13:35:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NDZ117061968;
	Fri, 23 Oct 2009 13:35:01 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NDZ16n061966;
	Fri, 23 Oct 2009 13:35:01 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200910231335.n9NDZ16n061966@svn.freebsd.org>
From: Robert Watson 
Date: Fri, 23 Oct 2009 13:35:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198393 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 13:35:01 -0000

Author: rwatson
Date: Fri Oct 23 13:35:00 2009
New Revision: 198393
URL: http://svn.freebsd.org/changeset/base/198393

Log:
  Improve grammar in ip_input comment while attempting to maintain what
  might be its meaning.
  
  MFC after:	3 days

Modified:
  head/sys/netinet/ip_input.c

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Fri Oct 23 13:32:26 2009	(r198392)
+++ head/sys/netinet/ip_input.c	Fri Oct 23 13:35:00 2009	(r198393)
@@ -530,8 +530,8 @@ tooshort:
 	}
 	if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) {
 		/*
-		 * Directly ship on the packet.  This allows to forward
-		 * packets that were destined for us to some other directly
+		 * Directly ship the packet on.  This allows forwarding
+		 * packets originally destined to us to ome other directly
 		 * connected host.
 		 */
 		ip_forward(m, dchg);

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 13:39:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1BEA9106568B;
	Fri, 23 Oct 2009 13:39:31 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0B4C08FC36;
	Fri, 23 Oct 2009 13:39:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NDdU4P062090;
	Fri, 23 Oct 2009 13:39:30 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NDdUTP062088;
	Fri, 23 Oct 2009 13:39:30 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910231339.n9NDdUTP062088@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 23 Oct 2009 13:39:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198394 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 13:39:31 -0000

Author: mav
Date: Fri Oct 23 13:39:30 2009
New Revision: 198394
URL: http://svn.freebsd.org/changeset/base/198394

Log:
  Make "Retrying Command" to be printed before actual retrying.
  It should make debug/error log a bit more readable.

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Fri Oct 23 13:35:00 2009	(r198393)
+++ head/sys/cam/cam_periph.c	Fri Oct 23 13:39:30 2009	(r198394)
@@ -1767,16 +1767,27 @@ cam_periph_error(union ccb *ccb, cam_fla
 		break;
 	}
 
+	/*
+	 * If we have and error and are booting verbosely, whine
+	 * *unless* this was a non-retryable selection timeout.
+	 */
+	if (error != 0 && bootverbose &&
+	    !(status == CAM_SEL_TIMEOUT && (camflags & CAM_RETRY_SELTO) == 0)) {
+		if (error != ERESTART) {
+			if (action_string == NULL)
+				action_string = "Unretryable Error";
+			xpt_print(ccb->ccb_h.path, "error %d\n", error);
+			xpt_print(ccb->ccb_h.path, "%s\n", action_string);
+		} else
+			xpt_print(ccb->ccb_h.path, "Retrying Command\n");
+	}
+
 	/* Attempt a retry */
-	if (error == ERESTART || error == 0) {	
+	if (error == ERESTART || error == 0) {
 		if (frozen != 0)
 			ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
-
-		if (error == ERESTART) {
-			action_string = "Retrying Command";
+		if (error == ERESTART)
 			xpt_action(ccb);
-		}
-		
 		if (frozen != 0)
 			cam_release_devq(ccb->ccb_h.path,
 					 relsim_flags,
@@ -1785,21 +1796,5 @@ cam_periph_error(union ccb *ccb, cam_fla
 					 /*getcount_only*/0);
 	}
 
-	/*
-	 * If we have and error and are booting verbosely, whine
-	 * *unless* this was a non-retryable selection timeout.
-	 */
-	if (error != 0 && bootverbose &&
-	    !(status == CAM_SEL_TIMEOUT && (camflags & CAM_RETRY_SELTO) == 0)) {
-
-
-		if (action_string == NULL)
-			action_string = "Unretryable Error";
-		if (error != ERESTART) {
-			xpt_print(ccb->ccb_h.path, "error %d\n", error);
-		}
-		xpt_print(ccb->ccb_h.path, "%s\n", action_string);
-	}
-
 	return (error);
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 14:27:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 032B3106566C;
	Fri, 23 Oct 2009 14:27:41 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC1AD8FC19;
	Fri, 23 Oct 2009 14:27:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NERecT063385;
	Fri, 23 Oct 2009 14:27:40 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NERe0J063382;
	Fri, 23 Oct 2009 14:27:40 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910231427.n9NERe0J063382@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 23 Oct 2009 14:27:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198400 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 14:27:41 -0000

Author: nwhitehorn
Date: Fri Oct 23 14:27:40 2009
New Revision: 198400
URL: http://svn.freebsd.org/changeset/base/198400

Log:
  Do not map the trap vectors into the kernel's address space. They are
  only used in real mode and keeping them mapped only serves to make NULL
  a valid address, which results in silent NULL pointer deferences.
  
  Suggested by:   Patrick Kerharo
  Obtained from:	projects/ppc64

Modified:
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/aim/trap_subr.S

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Fri Oct 23 14:22:51 2009	(r198399)
+++ head/sys/powerpc/aim/mmu_oea64.c	Fri Oct 23 14:27:40 2009	(r198400)
@@ -868,15 +868,17 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
 	ENABLE_TRANS(msr);
 
 	/*
-	 * Map certain important things, like ourselves and the exception
-	 * vectors
+	 * Map certain important things, like ourselves.
+	 *
+	 * NOTE: We do not map the exception vector space. That code is
+	 * used only in real mode, and leaving it unmapped allows us to
+	 * catch NULL pointer deferences, instead of making NULL a valid
+	 * address.
 	 */
 
 	DISABLE_TRANS(msr);
 	for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; pa += PAGE_SIZE) 
 		moea64_kenter(mmup, pa, pa);
-	for (pa = EXC_RSVD; pa < EXC_LAST; pa += PAGE_SIZE) 
-		moea64_kenter(mmup, pa, pa);
 	ENABLE_TRANS(msr);
 
 	if (!ofw_real_mode) {

Modified: head/sys/powerpc/aim/trap_subr.S
==============================================================================
--- head/sys/powerpc/aim/trap_subr.S	Fri Oct 23 14:22:51 2009	(r198399)
+++ head/sys/powerpc/aim/trap_subr.S	Fri Oct 23 14:27:40 2009	(r198400)
@@ -275,10 +275,16 @@ CNAME(restorebridgesize) = .-CNAME(resto
 /*
  * Processor reset exception handler. These are typically
  * the first instructions the processor executes after a
- * software reset.
+ * software reset. We do this in two bits so that we are
+ * not still hanging around in the trap handling region
+ * once the MMU is turned on.
  */
 	.globl	CNAME(rstcode), CNAME(rstsize)
 CNAME(rstcode):
+	ba	cpu_reset
+CNAME(rstsize) = . - CNAME(rstcode)
+
+cpu_reset:
 	bl	1f
 
 	.space	124
@@ -296,7 +302,6 @@ CNAME(rstcode):
 	/* Should not be reached */
 9:
 	b	9b
-CNAME(rstsize) = . - CNAME(rstcode)
 #endif
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 14:50:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85FD9106568D;
	Fri, 23 Oct 2009 14:50:11 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 69E488FC20;
	Fri, 23 Oct 2009 14:50:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NEoBkY064167;
	Fri, 23 Oct 2009 14:50:11 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NEoBuA064163;
	Fri, 23 Oct 2009 14:50:11 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200910231450.n9NEoBuA064163@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 23 Oct 2009 14:50:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198406 - in head: lib/libc/gen
	tools/regression/lib/libc/gen
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 14:50:11 -0000

Author: jilles
Date: Fri Oct 23 14:50:11 2009
New Revision: 198406
URL: http://svn.freebsd.org/changeset/base/198406

Log:
  wordexp(3): fix some bugs with signals and long outputs
  * retry various system calls on EINTR
  * retry the rest after a short read (common if there is more than about 1K
    of output)
  * block SIGCHLD like system(3) does (note that this does not and cannot
    work fully in threaded programs, they will need to be careful with wait
    functions)
  
  PR:		90580
  MFC after:	1 month

Modified:
  head/lib/libc/gen/wordexp.c
  head/tools/regression/lib/libc/gen/test-wordexp.c

Modified: head/lib/libc/gen/wordexp.c
==============================================================================
--- head/lib/libc/gen/wordexp.c	Fri Oct 23 14:43:17 2009	(r198405)
+++ head/lib/libc/gen/wordexp.c	Fri Oct 23 14:50:11 2009	(r198406)
@@ -28,8 +28,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -73,6 +75,24 @@ wordexp(const char * __restrict words, w
 	return (0);
 }
 
+static size_t
+we_read_fully(int fd, char *buffer, size_t len)
+{
+	size_t done;
+	ssize_t nread;
+
+	done = 0;
+	do {
+		nread = _read(fd, buffer + done, len - done);
+		if (nread == -1 && errno == EINTR)
+			continue;
+		if (nread <= 0)
+			break;
+		done += nread;
+	} while (done != len);
+	return done;
+}
+
 /*
  * we_askshell --
  *	Use the `wordexp' /bin/sh builtin function to do most of the work
@@ -90,20 +110,31 @@ we_askshell(const char *words, wordexp_t
 	size_t sofs;			/* Offset into we->we_strings */
 	size_t vofs;			/* Offset into we->we_wordv */
 	pid_t pid;			/* Process ID of child */
+	pid_t wpid;			/* waitpid return value */
 	int status;			/* Child exit status */
+	int error;			/* Our return value */
+	int serrno;			/* errno to return */
 	char *ifs;			/* IFS env. var. */
 	char *np, *p;			/* Handy pointers */
 	char *nstrings;			/* Temporary for realloc() */
 	char **nwv;			/* Temporary for realloc() */
+	sigset_t newsigblock, oldsigblock;
 
+	serrno = errno;
 	if ((ifs = getenv("IFS")) == NULL)
 		ifs = " \t\n";
 
 	if (pipe(pdes) < 0)
 		return (WRDE_NOSPACE);	/* XXX */
+	(void)sigemptyset(&newsigblock);
+	(void)sigaddset(&newsigblock, SIGCHLD);
+	(void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock);
 	if ((pid = fork()) < 0) {
+		serrno = errno;
 		_close(pdes[0]);
 		_close(pdes[1]);
+		(void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
+		errno = serrno;
 		return (WRDE_NOSPACE);	/* XXX */
 	}
 	else if (pid == 0) {
@@ -114,6 +145,7 @@ we_askshell(const char *words, wordexp_t
 		int devnull;
 		char *cmd;
 
+		(void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
 		_close(pdes[0]);
 		if (_dup2(pdes[1], STDOUT_FILENO) < 0)
 			_exit(1);
@@ -139,10 +171,11 @@ we_askshell(const char *words, wordexp_t
 	 * the expanded words separated by nulls.
 	 */
 	_close(pdes[1]);
-	if (_read(pdes[0], wbuf, 8) != 8 || _read(pdes[0], bbuf, 8) != 8) {
-		_close(pdes[0]);
-		_waitpid(pid, &status, 0);
-		return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX);
+	if (we_read_fully(pdes[0], wbuf, 8) != 8 ||
+			we_read_fully(pdes[0], bbuf, 8) != 8) {
+		error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX;
+		serrno = errno;
+		goto cleanup;
 	}
 	wbuf[8] = bbuf[8] = '\0';
 	nwords = strtol(wbuf, NULL, 16);
@@ -162,33 +195,38 @@ we_askshell(const char *words, wordexp_t
 	if ((nwv = realloc(we->we_wordv, (we->we_wordc + 1 +
 	    (flags & WRDE_DOOFFS ?  we->we_offs : 0)) *
 	    sizeof(char *))) == NULL) {
-		_close(pdes[0]);
-		_waitpid(pid, &status, 0);
-		return (WRDE_NOSPACE);
+		error = WRDE_NOSPACE;
+		goto cleanup;
 	}
 	we->we_wordv = nwv;
 	if ((nstrings = realloc(we->we_strings, we->we_nbytes)) == NULL) {
-		_close(pdes[0]);
-		_waitpid(pid, &status, 0);
-		return (WRDE_NOSPACE);
+		error = WRDE_NOSPACE;
+		goto cleanup;
 	}
 	for (i = 0; i < vofs; i++)
 		if (we->we_wordv[i] != NULL)
 			we->we_wordv[i] += nstrings - we->we_strings;
 	we->we_strings = nstrings;
 
-	if (_read(pdes[0], we->we_strings + sofs, nbytes) != nbytes) {
-		_close(pdes[0]);
-		_waitpid(pid, &status, 0);
-		return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX);
+	if (we_read_fully(pdes[0], we->we_strings + sofs, nbytes) != nbytes) {
+		error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX;
+		serrno = errno;
+		goto cleanup;
 	}
 
-	if (_waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) ||
-	    WEXITSTATUS(status) != 0) {
-		_close(pdes[0]);
-		return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX);
-	}
+	error = 0;
+cleanup:
 	_close(pdes[0]);
+	do
+		wpid = _waitpid(pid, &status, 0);
+	while (wpid < 0 && errno == EINTR);
+	(void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
+	if (error != 0) {
+		errno = serrno;
+		return (error);
+	}
+	if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0)
+		return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX);
 
 	/*
 	 * Break the null-terminated expanded word strings out into

Modified: head/tools/regression/lib/libc/gen/test-wordexp.c
==============================================================================
--- head/tools/regression/lib/libc/gen/test-wordexp.c	Fri Oct 23 14:43:17 2009	(r198405)
+++ head/tools/regression/lib/libc/gen/test-wordexp.c	Fri Oct 23 14:50:11 2009	(r198406)
@@ -32,17 +32,36 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+static void
+chld_handler(int x)
+{
+	int status, serrno;
+
+	(void)x;
+	serrno = errno;
+	while (waitpid(-1, &status, WNOHANG) > 0)
+		;
+	errno = serrno;
+}
+
 int
 main(int argc, char *argv[])
 {
+	struct sigaction sa;
 	wordexp_t we;
 	int r;
+	int i;
+	char longdata[6 * 10000 + 1];
 
 	/* Test that the macros are there. */
 	(void)(WRDE_APPEND + WRDE_DOOFFS + WRDE_NOCMD + WRDE_REUSE +
@@ -59,6 +78,15 @@ main(int argc, char *argv[])
 	assert(we.we_wordv[2] == NULL);
 	wordfree(&we);
 
+	/* Long output. */
+	for (i = 0; i < 10000; i++)
+		snprintf(longdata + 6 * i, 7, "%05d ", i);
+	r = wordexp(longdata, &we, 0);
+	assert(r == 0);
+	assert(we.we_wordc == 10000);
+	assert(we.we_wordv[10000] == NULL);
+	wordfree(&we);
+
 	/* WRDE_DOOFFS */
 	we.we_offs = 3;
 	r = wordexp("hello world", &we, WRDE_DOOFFS);
@@ -167,6 +195,20 @@ main(int argc, char *argv[])
 	r = wordexp("test } test", &we, 0);
 	assert(r == WRDE_BADCHAR);
 
+	/* With a SIGCHLD handler that reaps all zombies. */
+	sa.sa_flags = 0;
+	sigemptyset(&sa.sa_mask);
+	sa.sa_handler = chld_handler;
+	r = sigaction(SIGCHLD, &sa, NULL);
+	assert(r == 0);
+	r = wordexp("hello world", &we, 0);
+	assert(r == 0);
+	assert(we.we_wordc == 2);
+	assert(strcmp(we.we_wordv[0], "hello") == 0);
+	assert(strcmp(we.we_wordv[1], "world") == 0);
+	assert(we.we_wordv[2] == NULL);
+	wordfree(&we);
+
 	printf("PASS wordexp()\n");
 	printf("PASS wordfree()\n");
 

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 14:56:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9710E106568D;
	Fri, 23 Oct 2009 14:56:29 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 85B3C8FC16;
	Fri, 23 Oct 2009 14:56:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NEuTH4064312;
	Fri, 23 Oct 2009 14:56:29 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NEuTbr064307;
	Fri, 23 Oct 2009 14:56:29 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910231456.n9NEuTbr064307@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 23 Oct 2009 14:56:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198407 - head/sys/dev/ata
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 14:56:29 -0000

Author: mav
Date: Fri Oct 23 14:56:29 2009
New Revision: 198407
URL: http://svn.freebsd.org/changeset/base/198407

Log:
  MFp4:
  Do not differentiate 12/16 bytes ATAPI CCB formats when it is not needed.

Modified:
  head/sys/dev/ata/ata-queue.c
  head/sys/dev/ata/atapi-cd.c
  head/sys/dev/ata/atapi-fd.c
  head/sys/dev/ata/atapi-tape.c

Modified: head/sys/dev/ata/ata-queue.c
==============================================================================
--- head/sys/dev/ata/ata-queue.c	Fri Oct 23 14:50:11 2009	(r198406)
+++ head/sys/dev/ata/ata-queue.c	Fri Oct 23 14:56:29 2009	(r198407)
@@ -150,15 +150,11 @@ ata_atapicmd(device_t dev, u_int8_t *ccb
 	     int count, int flags, int timeout)
 {
     struct ata_request *request = ata_alloc_request();
-    struct ata_device *atadev = device_get_softc(dev);
     int error = ENOMEM;
 
     if (request) {
 	request->dev = dev;
-	if ((atadev->param.config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12)
-	    bcopy(ccb, request->u.atapi.ccb, 12);
-	else
-	    bcopy(ccb, request->u.atapi.ccb, 16);
+	bcopy(ccb, request->u.atapi.ccb, 16);
 	request->data = data;
 	request->bytecount = count;
 	request->transfersize = min(request->bytecount, 65534);

Modified: head/sys/dev/ata/atapi-cd.c
==============================================================================
--- head/sys/dev/ata/atapi-cd.c	Fri Oct 23 14:50:11 2009	(r198406)
+++ head/sys/dev/ata/atapi-cd.c	Fri Oct 23 14:56:29 2009	(r198407)
@@ -863,9 +863,7 @@ acd_strategy(struct bio *bp)
     }
     request->dev = dev;
     request->bio = bp;
-    bcopy(ccb, request->u.atapi.ccb,
-	  (atadev->param.config & ATA_PROTO_MASK) == 
-	  ATA_PROTO_ATAPI_12 ? 16 : 12);
+    bcopy(ccb, request->u.atapi.ccb, 16);
     request->data = bp->bio_data;
     request->bytecount = count * blocksize;
     request->transfersize = min(request->bytecount, 65534);

Modified: head/sys/dev/ata/atapi-fd.c
==============================================================================
--- head/sys/dev/ata/atapi-fd.c	Fri Oct 23 14:50:11 2009	(r198406)
+++ head/sys/dev/ata/atapi-fd.c	Fri Oct 23 14:56:29 2009	(r198407)
@@ -240,9 +240,7 @@ afd_strategy(struct bio *bp)
     }
     request->dev = dev;
     request->bio = bp;
-    bcopy(ccb, request->u.atapi.ccb,
-	  (atadev->param.config & ATA_PROTO_MASK) == 
-	  ATA_PROTO_ATAPI_12 ? 16 : 12);
+    bcopy(ccb, request->u.atapi.ccb, 16);
     request->data = bp->bio_data;
     request->bytecount = count * fdp->sectorsize;
     request->transfersize = min(request->bytecount, 65534);

Modified: head/sys/dev/ata/atapi-tape.c
==============================================================================
--- head/sys/dev/ata/atapi-tape.c	Fri Oct 23 14:50:11 2009	(r198406)
+++ head/sys/dev/ata/atapi-tape.c	Fri Oct 23 14:56:29 2009	(r198407)
@@ -373,7 +373,6 @@ static void 
 ast_strategy(struct bio *bp)
 {
     device_t dev = bp->bio_dev->si_drv1;
-    struct ata_device *atadev = device_get_softc(dev);
     struct ast_softc *stp = device_get_ivars(dev);
     struct ata_request *request;
     u_int32_t blkcount;
@@ -426,9 +425,7 @@ ast_strategy(struct bio *bp)
     }
     request->dev = dev;
     request->driver = bp;
-    bcopy(ccb, request->u.atapi.ccb,
-	  (atadev->param.config & ATA_PROTO_MASK) == 
-	  ATA_PROTO_ATAPI_12 ? 16 : 12);
+    bcopy(ccb, request->u.atapi.ccb, 16);
     request->data = bp->bio_data;
     request->bytecount = blkcount * stp->blksize;
     request->transfersize = min(request->bytecount, 65534);

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 15:09:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 546EF106566C;
	Fri, 23 Oct 2009 15:09:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 432B88FC16;
	Fri, 23 Oct 2009 15:09:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NF9pJa064640;
	Fri, 23 Oct 2009 15:09:51 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NF9pj3064638;
	Fri, 23 Oct 2009 15:09:51 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910231509.n9NF9pj3064638@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Oct 2009 15:09:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198408 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 15:09:52 -0000

Author: jhb
Date: Fri Oct 23 15:09:51 2009
New Revision: 198408
URL: http://svn.freebsd.org/changeset/base/198408

Log:
  Don't bother copying the name of a kproc or kthread out into a temporary
  array just to pass that array to printf().  kproc and kthread names are
  NUL-terminated and can be printed using printf() directly.
  
  Reviewed by:	bde

Modified:
  head/sys/kern/kern_shutdown.c

Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c	Fri Oct 23 14:56:29 2009	(r198407)
+++ head/sys/kern/kern_shutdown.c	Fri Oct 23 15:09:51 2009	(r198408)
@@ -618,16 +618,14 @@ void
 kproc_shutdown(void *arg, int howto)
 {
 	struct proc *p;
-	char procname[MAXCOMLEN + 1];
 	int error;
 
 	if (panicstr)
 		return;
 
 	p = (struct proc *)arg;
-	strlcpy(procname, p->p_comm, sizeof(procname));
 	printf("Waiting (max %d seconds) for system process `%s' to stop...",
-	    kproc_shutdown_wait, procname);
+	    kproc_shutdown_wait, p->p_comm);
 	error = kproc_suspend(p, kproc_shutdown_wait * hz);
 
 	if (error == EWOULDBLOCK)
@@ -640,16 +638,14 @@ void
 kthread_shutdown(void *arg, int howto)
 {
 	struct thread *td;
-	char procname[MAXCOMLEN + 1];
 	int error;
 
 	if (panicstr)
 		return;
 
 	td = (struct thread *)arg;
-	strlcpy(procname, td->td_name, sizeof(procname));
 	printf("Waiting (max %d seconds) for system thread `%s' to stop...",
-	    kproc_shutdown_wait, procname);
+	    kproc_shutdown_wait, td->td_name);
 	error = kthread_suspend(td, kproc_shutdown_wait * hz);
 
 	if (error == EWOULDBLOCK)

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 15:10:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D3F810656D3;
	Fri, 23 Oct 2009 15:10:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C62E8FC0A;
	Fri, 23 Oct 2009 15:10:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NFAfPM064710;
	Fri, 23 Oct 2009 15:10:41 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NFAfKM064708;
	Fri, 23 Oct 2009 15:10:41 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910231510.n9NFAfKM064708@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Oct 2009 15:10:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198409 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 15:10:41 -0000

Author: jhb
Date: Fri Oct 23 15:10:41 2009
New Revision: 198409
URL: http://svn.freebsd.org/changeset/base/198409

Log:
  Style fix.

Modified:
  head/sys/sys/ktrace.h

Modified: head/sys/sys/ktrace.h
==============================================================================
--- head/sys/sys/ktrace.h	Fri Oct 23 15:09:51 2009	(r198408)
+++ head/sys/sys/ktrace.h	Fri Oct 23 15:10:41 2009	(r198409)
@@ -52,7 +52,7 @@ struct ktr_header {
 	int	ktr_len;		/* length of buf */
 	short	ktr_type;		/* trace record type */
 	pid_t	ktr_pid;		/* process id */
-	char	ktr_comm[MAXCOMLEN+1];	/* command name */
+	char	ktr_comm[MAXCOMLEN + 1];/* command name */
 	struct	timeval ktr_time;	/* timestamp */
 	intptr_t	ktr_tid;	/* was ktr_buffer */
 };

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 15:14:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE247106568D;
	Fri, 23 Oct 2009 15:14:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AC18A8FC13;
	Fri, 23 Oct 2009 15:14:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NFEsNU064879;
	Fri, 23 Oct 2009 15:14:54 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NFEsfW064873;
	Fri, 23 Oct 2009 15:14:54 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200910231514.n9NFEsfW064873@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 23 Oct 2009 15:14:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198411 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 15:14:54 -0000

Author: jhb
Date: Fri Oct 23 15:14:54 2009
New Revision: 198411
URL: http://svn.freebsd.org/changeset/base/198411

Log:
  - Fix several off-by-one errors when using MAXCOMLEN.  The p_comm[] and
    td_name[] arrays are actually MAXCOMLEN + 1 in size and a few places that
    created shadow copies of these arrays were just using MAXCOMLEN.
  - Prefer using sizeof() of an array type to explicit constants for the
    array length in a few places.
  - Ensure that all of p_comm[] and td_name[] is always zero'd during
    execve() to guard against any possible information leaks.  Previously
    trailing garbage in p_comm[] could be leaked to userland in ktrace
    record headers via td_name[].
  
  Reviewed by:	bde

Modified:
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_ktrace.c
  head/sys/kern/subr_bus.c
  head/sys/kern/subr_taskqueue.c
  head/sys/sys/interrupt.h

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Fri Oct 23 15:12:05 2009	(r198410)
+++ head/sys/kern/kern_exec.c	Fri Oct 23 15:14:54 2009	(r198411)
@@ -326,7 +326,7 @@ do_execve(td, args, mac_p)
 	struct ucred *newcred = NULL, *oldcred;
 	struct uidinfo *euip;
 	register_t *stack_base;
-	int error, len = 0, i;
+	int error, i;
 	struct image_params image_params, *imgp;
 	struct vattr attr;
 	int (*img_first)(struct image_params *);
@@ -602,18 +602,12 @@ interpret:
 	execsigs(p);
 
 	/* name this process - nameiexec(p, ndp) */
-	if (args->fname) {
-		len = min(nd.ni_cnd.cn_namelen,MAXCOMLEN);
-		bcopy(nd.ni_cnd.cn_nameptr, p->p_comm, len);
-	} else {
-		if (vn_commname(binvp, p->p_comm, MAXCOMLEN + 1) == 0)
-			len = MAXCOMLEN;
-		else {
-			len = sizeof(fexecv_proc_title);
-			bcopy(fexecv_proc_title, p->p_comm, len);
-		}
-	}
-	p->p_comm[len] = 0;
+	bzero(p->p_comm, sizeof(p->p_comm));
+	if (args->fname)
+		bcopy(nd.ni_cnd.cn_nameptr, p->p_comm,
+		    min(nd.ni_cnd.cn_namelen, MAXCOMLEN));
+	else if (vn_commname(binvp, p->p_comm, sizeof(p->p_comm)) != 0)
+		bcopy(fexecv_proc_title, p->p_comm, sizeof(fexecv_proc_title));
 	bcopy(p->p_comm, td->td_name, sizeof(td->td_name));
 
 	/*

Modified: head/sys/kern/kern_ktrace.c
==============================================================================
--- head/sys/kern/kern_ktrace.c	Fri Oct 23 15:12:05 2009	(r198410)
+++ head/sys/kern/kern_ktrace.c	Fri Oct 23 15:14:54 2009	(r198411)
@@ -256,6 +256,10 @@ ktrace_resize_pool(u_int newsize)
 	return (ktr_requestpool);
 }
 
+/* ktr_getrequest() assumes that ktr_comm[] is the same size as td_name[]. */
+CTASSERT(sizeof(((struct ktr_header *)NULL)->ktr_comm) ==
+    (sizeof((struct thread *)NULL)->td_name));
+
 static struct ktr_request *
 ktr_getrequest(int type)
 {
@@ -283,7 +287,8 @@ ktr_getrequest(int type)
 		microtime(&req->ktr_header.ktr_time);
 		req->ktr_header.ktr_pid = p->p_pid;
 		req->ktr_header.ktr_tid = td->td_tid;
-		bcopy(td->td_name, req->ktr_header.ktr_comm, MAXCOMLEN + 1);
+		bcopy(td->td_name, req->ktr_header.ktr_comm,
+		    sizeof(req->ktr_header.ktr_comm));
 		req->ktr_buffer = NULL;
 		req->ktr_header.ktr_len = 0;
 	} else {

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Fri Oct 23 15:12:05 2009	(r198410)
+++ head/sys/kern/subr_bus.c	Fri Oct 23 15:14:54 2009	(r198411)
@@ -3861,8 +3861,8 @@ int
 bus_describe_intr(device_t dev, struct resource *irq, void *cookie,
     const char *fmt, ...)
 {
-	char descr[MAXCOMLEN];
 	va_list ap;
+	char descr[MAXCOMLEN + 1];
 
 	if (dev->parent == NULL)
 		return (EINVAL);

Modified: head/sys/kern/subr_taskqueue.c
==============================================================================
--- head/sys/kern/subr_taskqueue.c	Fri Oct 23 15:12:05 2009	(r198410)
+++ head/sys/kern/subr_taskqueue.c	Fri Oct 23 15:14:54 2009	(r198411)
@@ -301,7 +301,7 @@ taskqueue_start_threads(struct taskqueue
 	struct thread *td;
 	struct taskqueue *tq;
 	int i, error;
-	char ktname[MAXCOMLEN];
+	char ktname[MAXCOMLEN + 1];
 
 	if (count <= 0)
 		return (EINVAL);
@@ -309,7 +309,7 @@ taskqueue_start_threads(struct taskqueue
 	tq = *tqp;
 
 	va_start(ap, name);
-	vsnprintf(ktname, MAXCOMLEN, name, ap);
+	vsnprintf(ktname, sizeof(ktname), name, ap);
 	va_end(ap);
 
 	tq->tq_threads = malloc(sizeof(struct thread *) * count, M_TASKQUEUE,

Modified: head/sys/sys/interrupt.h
==============================================================================
--- head/sys/sys/interrupt.h	Fri Oct 23 15:12:05 2009	(r198410)
+++ head/sys/sys/interrupt.h	Fri Oct 23 15:14:54 2009	(r198411)
@@ -47,7 +47,7 @@ struct intr_handler {
 	driver_intr_t	*ih_handler;	/* Threaded handler function. */
 	void		*ih_argument;	/* Argument to pass to handlers. */
 	int		 ih_flags;
-	char		 ih_name[MAXCOMLEN]; /* Name of handler. */
+	char		 ih_name[MAXCOMLEN + 1]; /* Name of handler. */
 	struct intr_event *ih_event;	/* Event we are connected to. */
 	int		 ih_need;	/* Needs service. */
 	TAILQ_ENTRY(intr_handler) ih_next; /* Next handler for this event. */
@@ -104,8 +104,8 @@ struct intr_handler {
 struct intr_event {
 	TAILQ_ENTRY(intr_event) ie_list;
 	TAILQ_HEAD(, intr_handler) ie_handlers; /* Interrupt handlers. */
-	char		ie_name[MAXCOMLEN]; /* Individual event name. */
-	char		ie_fullname[MAXCOMLEN];
+	char		ie_name[MAXCOMLEN + 1]; /* Individual event name. */
+	char		ie_fullname[MAXCOMLEN + 1];
 	struct mtx	ie_lock;
 	void		*ie_source;	/* Cookie used by MD code. */
 	struct intr_thread *ie_thread;	/* Thread we are connected to. */

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 17:26:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D599F1065679;
	Fri, 23 Oct 2009 17:26:29 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C439C8FC13;
	Fri, 23 Oct 2009 17:26:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NHQTmT067567;
	Fri, 23 Oct 2009 17:26:29 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NHQTDN067565;
	Fri, 23 Oct 2009 17:26:29 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200910231726.n9NHQTDN067565@svn.freebsd.org>
From: Robert Watson 
Date: Fri, 23 Oct 2009 17:26:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198417 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 17:26:29 -0000

Author: rwatson
Date: Fri Oct 23 17:26:29 2009
New Revision: 198417
URL: http://svn.freebsd.org/changeset/base/198417

Log:
  Remove unneeded blank line from bpf_drvinit().
  
  MFC after:	3 days

Modified:
  head/sys/net/bpf.c

Modified: head/sys/net/bpf.c
==============================================================================
--- head/sys/net/bpf.c	Fri Oct 23 17:02:37 2009	(r198416)
+++ head/sys/net/bpf.c	Fri Oct 23 17:26:29 2009	(r198417)
@@ -2038,7 +2038,6 @@ bpf_drvinit(void *unused)
 	dev = make_dev(&bpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "bpf");
 	/* For compatibility */
 	make_dev_alias(dev, "bpf0");
-
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 18:27:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ABA38106566B;
	Fri, 23 Oct 2009 18:27:35 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7FF918FC17;
	Fri, 23 Oct 2009 18:27:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NIRZ2M068783;
	Fri, 23 Oct 2009 18:27:35 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NIRZ9D068779;
	Fri, 23 Oct 2009 18:27:35 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <200910231827.n9NIRZ9D068779@svn.freebsd.org>
From: Qing Li 
Date: Fri, 23 Oct 2009 18:27:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198418 - in head/sys: netinet netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 18:27:35 -0000

Author: qingli
Date: Fri Oct 23 18:27:34 2009
New Revision: 198418
URL: http://svn.freebsd.org/changeset/base/198418

Log:
  Use the correct option name in the preprocessor command to enable
  or disable diagnostic messages.
  
  Reviewed by:	ru
  MFC after:	3 days

Modified:
  head/sys/netinet/if_ether.c
  head/sys/netinet/in.c
  head/sys/netinet6/in6.c

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Fri Oct 23 17:26:29 2009	(r198417)
+++ head/sys/netinet/if_ether.c	Fri Oct 23 18:27:34 2009	(r198418)
@@ -180,7 +180,7 @@ arptimer(void *arg)
 		(void) llentry_free(lle);
 		ARPSTAT_INC(timeouts);
 	} 
-#ifdef DIAGNOSTICS
+#ifdef DIAGNOSTIC
 	else {
 		struct sockaddr *l3addr = L3_ADDR(lle);
 		log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle,

Modified: head/sys/netinet/in.c
==============================================================================
--- head/sys/netinet/in.c	Fri Oct 23 17:26:29 2009	(r198417)
+++ head/sys/netinet/in.c	Fri Oct 23 18:27:34 2009	(r198418)
@@ -1327,7 +1327,7 @@ in_lltable_rtcheck(struct ifnet *ifp, co
 	/* XXX rtalloc1 should take a const param */
 	rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0);
 	if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || rt->rt_ifp != ifp) {
-#ifdef DIAGNOSTICS
+#ifdef DIAGNOSTIC
 		log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n",
 		    inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr));
 #endif
@@ -1366,7 +1366,7 @@ in_lltable_lookup(struct lltable *llt, u
 			break;
 	}
 	if (lle == NULL) {
-#ifdef DIAGNOSTICS
+#ifdef DIAGNOSTIC
 		if (flags & LLE_DELETE)
 			log(LOG_INFO, "interface address is missing from cache = %p  in delete\n", lle);	
 #endif
@@ -1401,7 +1401,7 @@ in_lltable_lookup(struct lltable *llt, u
 			lle->la_flags = LLE_DELETED;
 			EVENTHANDLER_INVOKE(arp_update_event, lle);
 			LLE_WUNLOCK(lle);
-#ifdef DIAGNOSTICS
+#ifdef DIAGNOSTIC
 			log(LOG_INFO, "ifaddr cache = %p  is deleted\n", lle);	
 #endif
 		}

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Fri Oct 23 17:26:29 2009	(r198417)
+++ head/sys/netinet6/in6.c	Fri Oct 23 18:27:34 2009	(r198418)
@@ -2437,7 +2437,7 @@ in6_lltable_lookup(struct lltable *llt, 
 			LLE_WLOCK(lle);
 			lle->la_flags = LLE_DELETED;
 			LLE_WUNLOCK(lle);
-#ifdef DIAGNOSTICS
+#ifdef DIAGNOSTIC
 			log(LOG_INFO, "ifaddr cache = %p  is deleted\n", lle);	
 #endif	
 		}

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 18:41:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ADB61106568B;
	Fri, 23 Oct 2009 18:41:00 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9BFCC8FC18;
	Fri, 23 Oct 2009 18:41:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NIf0B7069065;
	Fri, 23 Oct 2009 18:41:00 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NIf0L5069062;
	Fri, 23 Oct 2009 18:41:00 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200910231841.n9NIf0L5069062@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 23 Oct 2009 18:41:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198419 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 18:41:00 -0000

Author: jkim
Date: Fri Oct 23 18:41:00 2009
New Revision: 198419
URL: http://svn.freebsd.org/changeset/base/198419

Log:
  - When we restore VESA state, try BIOS POST earlier.  VESA restore state
  function may not work properly if we don't.  Turn off hardware cursor as
  vesa_set_mode() does.
  - Add VBE 3.0 specific fields in VESA mode structure and pack it.  Note
  the padding is 190 bytes although VBE 3.0 says 189 bytes.  It must be wrong
  because the size of structure becomes 255 bytes and the specification says
  it must be 256 bytes in total.  In fact, an example code in the spec. does
  it right, though.  While we are at it, fix some i386-isms.
  - Remove state buffer size limitation.  It is no longer necessary since
  sys/compat/x86bios/x86bios.c r198251.
  - Move int 0x10 vector test into vesa_bios_post() as we always do it anyway.

Modified:
  head/sys/dev/fb/vesa.c
  head/sys/dev/fb/vesa.h

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Fri Oct 23 18:27:34 2009	(r198418)
+++ head/sys/dev/fb/vesa.c	Fri Oct 23 18:41:00 2009	(r198419)
@@ -74,8 +74,7 @@ typedef struct adp_state adp_state_t;
 
 /* VESA video adapter */
 static video_adapter_t *vesa_adp = NULL;
-static int vesa_state_buf_size = 0;
-#define VESA_BIOS_BUFSIZE	(3 * PAGE_SIZE)
+static ssize_t vesa_state_buf_size = -1;
 
 /* VESA functions */
 #if 0
@@ -188,7 +187,7 @@ static int vesa_bios_load_palette2(int s
 #define STATE_REG	(1<<3)
 #define STATE_MOST	(STATE_HW | STATE_DATA | STATE_REG)
 #define STATE_ALL	(STATE_HW | STATE_DATA | STATE_DAC | STATE_REG)
-static int vesa_bios_state_buf_size(void);
+static ssize_t vesa_bios_state_buf_size(void);
 static int vesa_bios_save_restore(int code, void *p, size_t size);
 static int vesa_bios_get_line_length(void);
 static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines);
@@ -282,6 +281,10 @@ vesa_bios_post(void)
 	}
 	regs.R_DL = 0x80;
 	x86bios_call(®s, 0xc000, 0x0003);
+
+	if (x86bios_get_intr(0x10) == 0)
+		return (1);
+
 	return (0);
 }
 
@@ -532,7 +535,7 @@ vesa_bios_load_palette2(int start, int c
 }
 #endif
 
-static int
+static ssize_t
 vesa_bios_state_buf_size(void)
 {
 	x86regs_t regs;
@@ -557,9 +560,6 @@ vesa_bios_save_restore(int code, void *p
 	uint32_t offs;
 	void *buf;
 
-	if (size > VESA_BIOS_BUFSIZE)
-		return (1);
-
 	if (code != STATE_SAVE && code != STATE_LOAD)
 		return (1);
 
@@ -808,12 +808,11 @@ vesa_bios_init(void)
 	if (x86bios_get_intr(0x10) == 0) {
 		if (vesa_bios_post() != 0)
 			return (1);
-		offs = x86bios_get_intr(0x10);
-		if (offs == 0)
-			return (1);
-		if (bootverbose)
+		if (bootverbose) {
+			offs = x86bios_get_intr(0x10);
 			printf("VESA: interrupt vector installed (0x%x)\n",
 			    BIOS_SADDRTOLADDR(offs));
+		}
 	}
 
 	x86bios_init_regs(®s);
@@ -879,6 +878,22 @@ vesa_bios_init(void)
 		if (vesa_bios_get_mode(vesa_vmodetab[i], &vmode))
 			continue;
 
+		vmode.v_modeattr = le16toh(vmode.v_modeattr);
+		vmode.v_wgran = le16toh(vmode.v_wgran);
+		vmode.v_wsize = le16toh(vmode.v_wsize);
+		vmode.v_waseg = le16toh(vmode.v_waseg);
+		vmode.v_wbseg = le16toh(vmode.v_wbseg);
+		vmode.v_posfunc = le32toh(vmode.v_posfunc);
+		vmode.v_bpscanline = le16toh(vmode.v_bpscanline);
+		vmode.v_width = le16toh(vmode.v_width);
+		vmode.v_height = le16toh(vmode.v_height);
+		vmode.v_lfb = le32toh(vmode.v_lfb);
+		vmode.v_offscreen = le32toh(vmode.v_offscreen);
+		vmode.v_offscreensize = le16toh(vmode.v_offscreensize);
+		vmode.v_maxpixelclock = le32toh(vmode.v_maxpixelclock);
+		vmode.v_linbpscanline = le16toh(vmode.v_linbpscanline);
+		vmode.v_maxpixelclock = le32toh(vmode.v_maxpixelclock);
+
 		/* reject unsupported modes */
 #if 0
 		if ((vmode.v_modeattr & (V_MODESUPP | V_MODEOPTINFO 
@@ -1417,11 +1432,14 @@ vesa_save_state(video_adapter_t *adp, vo
 	if (adp != vesa_adp)
 		return ((*prevvidsw->save_state)(adp, p, size));
 
-	if (vesa_state_buf_size == 0)
+	if (vesa_state_buf_size == -1) {
 		vesa_state_buf_size = vesa_bios_state_buf_size();
+		if (vesa_state_buf_size == 0)
+			return (1);
+	}
 	if (size == 0)
-		return (sizeof(int) + vesa_state_buf_size);
-	else if (size < (sizeof(int) + vesa_state_buf_size))
+		return (offsetof(adp_state_t, regs) + vesa_state_buf_size);
+	else if (size < (offsetof(adp_state_t, regs) + vesa_state_buf_size))
 		return (1);
 
 	((adp_state_t *)p)->sig = V_STATE_SIG;
@@ -1438,22 +1456,36 @@ vesa_load_state(video_adapter_t *adp, vo
 	if ((adp != vesa_adp) || (((adp_state_t *)p)->sig != V_STATE_SIG))
 		return ((*prevvidsw->load_state)(adp, p));
 
+	if (vesa_state_buf_size <= 0)
+		return (1);
+
+	/*
+	 * If the current mode is not the same, probably it was powered down.
+	 * Try BIOS POST to restore a sane state.
+	 */
+	mode = vesa_bios_get_current_mode();
+	if (mode >= 0 && (mode & 0x1ff) != adp->va_mode &&
+	    VESA_MODE(adp->va_mode))
+		(void)vesa_bios_post();
+
 	ret = vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs,
 	    vesa_state_buf_size);
 
 	/*
-	 * If the current mode is not restored properly, try BIOS POST and
-	 * force setting the mode.
+	 * If the desired mode is not restored, force setting the mode.
 	 */
-	flags = adp->va_info.vi_flags;
-	if (!(flags & V_INFO_GRAPHICS))
-		flags &= ~V_INFO_LINEAR;
-	mode = adp->va_mode | ((flags & V_INFO_LINEAR) ? 0x4000 : 0);
-	if (vesa_bios_get_current_mode() != mode && vesa_bios_post() == 0 &&
-	    x86bios_get_intr(0x10) != 0) {
-		int10_set_mode(adp->va_initial_bios_mode);
-		vesa_bios_set_mode(mode);
+	mode = vesa_bios_get_current_mode();
+	if (mode >= 0 && (mode & 0x1ff) != adp->va_mode &&
+	    VESA_MODE(adp->va_mode)) {
+		mode = adp->va_mode;
+		flags = adp->va_info.vi_flags;
+		if ((flags & V_INFO_GRAPHICS) != 0 &&
+		    (flags & V_INFO_LINEAR) != 0)
+			mode |= 0x4000;
+		(void)vesa_bios_set_mode(mode);
+		(void)(*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
 	}
+
 	return (ret);
 }
 

Modified: head/sys/dev/fb/vesa.h
==============================================================================
--- head/sys/dev/fb/vesa.h	Fri Oct 23 18:27:34 2009	(r198418)
+++ head/sys/dev/fb/vesa.h	Fri Oct 23 18:41:00 2009	(r198419)
@@ -108,7 +108,21 @@ struct vesa_mode 
     u_int32_t		v_lfb;
     u_int32_t		v_offscreen;
     u_int16_t		v_offscreensize;
-};
+    /* 3.0 implementations */
+    u_int16_t		v_linbpscanline;
+    u_int8_t		v_bankipages;
+    u_int8_t		v_linipages;
+    u_int8_t		v_linredmasksize;
+    u_int8_t		v_linredfieldpos;
+    u_int8_t		v_lingreenmasksize;
+    u_int8_t		v_lingreenfieldpos;
+    u_int8_t		v_linbluemasksize;
+    u_int8_t		v_linbluefieldpos;
+    u_int8_t		v_linresmasksize;
+    u_int8_t		v_linresfieldpos;
+    u_int32_t		v_maxpixelclock;
+    u_int8_t		v_reserved1[190];
+} __packed;
 
 #ifdef _KERNEL
 

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 18:44:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB3AD106566B;
	Fri, 23 Oct 2009 18:44:53 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 98B148FC1A;
	Fri, 23 Oct 2009 18:44:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NIirIq069178;
	Fri, 23 Oct 2009 18:44:53 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NIir6v069173;
	Fri, 23 Oct 2009 18:44:53 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200910231844.n9NIir6v069173@svn.freebsd.org>
From: Robert Noland 
Date: Fri, 23 Oct 2009 18:44:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198420 - in head/sys: boot/i386/zfsboot boot/zfs
	cddl/boot/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 18:44:53 -0000

Author: rnoland
Date: Fri Oct 23 18:44:53 2009
New Revision: 198420
URL: http://svn.freebsd.org/changeset/base/198420

Log:
  Correct some issues with zfs boot.
  
   - Teach it to read gang blocks. (essentially untested)
     If you see "ZFS: gang block detected!", please let
     me know, so we can either remove the printf if it
     works, or fix it if it doesn't.
  
   - If multiple partitions exist on a disk, probe them all.
     We also need to reset dsk->start to 0 to read the right
     sector here.
  
   - With GPT, we can have 128 partitions.
  
   - If the bootfs property has ever been set on a pool
     it seems that it never goes away.  zpool won't allow
     you to add to the pool with the bootfs property set.
     However, if you clear the property back to default
     we end up getting 0 for the object number and read
     a bogus block pointer and fail to boot.
  
   - Fix some error printfs. The printf in the loader is
     only capable of c,s and u formats.
  
   - Teach printf how to display %llu
  
  Reviewed by:	dfr, jhb
  MFC after:	2 weeks

Modified:
  head/sys/boot/i386/zfsboot/zfsboot.c
  head/sys/boot/zfs/zfs.c
  head/sys/boot/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfsimpl.h

Modified: head/sys/boot/i386/zfsboot/zfsboot.c
==============================================================================
--- head/sys/boot/i386/zfsboot/zfsboot.c	Fri Oct 23 18:41:00 2009	(r198419)
+++ head/sys/boot/i386/zfsboot/zfsboot.c	Fri Oct 23 18:44:53 2009	(r198420)
@@ -474,6 +474,7 @@ probe_drive(struct dsk *dsk, spa_t **spa
     slba = hdr.hdr_lba_table;
     elba = slba + hdr.hdr_entries / entries_per_sec;
     while (slba < elba) {
+	dsk->start = 0;
 	if (drvread(dsk, sec, slba, 1))
 	    return;
 	for (part = 0; part < entries_per_sec; part++) {
@@ -494,7 +495,6 @@ probe_drive(struct dsk *dsk, spa_t **spa
 		     */
 		    dsk = copy_dsk(dsk);
 		}
-		break;
 	    }
 	}
 	slba++;
@@ -857,12 +857,13 @@ static void
 printf(const char *fmt,...)
 {
     va_list ap;
-    char buf[10];
+    char buf[20];
     char *s;
-    unsigned u;
+    unsigned long long u;
     int c;
     int minus;
     int prec;
+    int l;
     int len;
     int pad;
 
@@ -871,6 +872,7 @@ printf(const char *fmt,...)
 	if (c == '%') {
 	    minus = 0;
 	    prec = 0;
+	    l = 0;
 	nextfmt:
 	    c = *fmt++;
 	    switch (c) {
@@ -892,6 +894,9 @@ printf(const char *fmt,...)
 	    case 'c':
 		putchar(va_arg(ap, int));
 		continue;
+	    case 'l':
+		l++;
+		goto nextfmt;
 	    case 's':
 		s = va_arg(ap, char *);
 		if (prec) {
@@ -914,7 +919,17 @@ printf(const char *fmt,...)
 		}
 		continue;
 	    case 'u':
-		u = va_arg(ap, unsigned);
+		switch (l) {
+		case 2:
+		    u = va_arg(ap, unsigned long long);
+		    break;
+		case 1:
+		    u = va_arg(ap, unsigned long);
+		    break;
+		default:
+		    u = va_arg(ap, unsigned);
+		    break;
+		}
 		s = buf;
 		do
 		    *s++ = '0' + u % 10U;

Modified: head/sys/boot/zfs/zfs.c
==============================================================================
--- head/sys/boot/zfs/zfs.c	Fri Oct 23 18:41:00 2009	(r198419)
+++ head/sys/boot/zfs/zfs.c	Fri Oct 23 18:44:53 2009	(r198420)
@@ -100,7 +100,7 @@ zfs_open(const char *upath, struct open_
 	f->f_fsdata = (void *)fp;
 
 	if (spa->spa_root_objset.os_type != DMU_OST_ZFS) {
-		printf("Unexpected object set type %lld\n",
+		printf("Unexpected object set type %llu\n",
 		    spa->spa_root_objset.os_type);
 		rc = EIO;
 		goto out;
@@ -413,7 +413,7 @@ zfs_dev_init(void) 
 		if (vdev_probe(vdev_read, (void*) (uintptr_t) fd, 0))
 			close(fd);
 
-		for (slice = 1; slice <= 4; slice++) {
+		for (slice = 1; slice <= 128; slice++) {
 			sprintf(devname, "disk%dp%d:", unit, slice);
 			fd = open(devname, O_RDONLY);
 			if (fd == -1) {

Modified: head/sys/boot/zfs/zfsimpl.c
==============================================================================
--- head/sys/boot/zfs/zfsimpl.c	Fri Oct 23 18:41:00 2009	(r198419)
+++ head/sys/boot/zfs/zfsimpl.c	Fri Oct 23 18:44:53 2009	(r198420)
@@ -53,6 +53,8 @@ static char *zfs_temp_buf, *zfs_temp_end
 
 #define TEMP_SIZE	(1*SPA_MAXBLOCKSIZE)
 
+static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf);
+
 static void
 zfs_init(void)
 {
@@ -897,6 +899,33 @@ ilog2(int n)
 }
 
 static int
+zio_read_gang(spa_t *spa, const blkptr_t *bp, const dva_t *dva, void *buf)
+{
+	zio_gbh_phys_t zio_gb;
+	vdev_t *vdev;
+	int vdevid;
+	off_t offset;
+	int i;
+
+	vdevid = DVA_GET_VDEV(dva);
+	offset = DVA_GET_OFFSET(dva);
+	STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink)
+		if (vdev->v_id == vdevid)
+			break;
+	if (!vdev || !vdev->v_read)
+		return (EIO);
+	if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE))
+		return (EIO);
+
+	for (i = 0; i < SPA_GBH_NBLKPTRS; i++) {
+		if (zio_read(spa, &zio_gb.zg_blkptr[i], buf))
+			return (EIO);
+	}
+ 
+	return (0);
+}
+
+static int
 zio_read(spa_t *spa, const blkptr_t *bp, void *buf)
 {
 	int cpfunc = BP_GET_COMPRESS(bp);
@@ -920,20 +949,27 @@ zio_read(spa_t *spa, const blkptr_t *bp,
 		if (!dva->dva_word[0] && !dva->dva_word[1])
 			continue;
 
-		vdevid = DVA_GET_VDEV(dva);
-		offset = DVA_GET_OFFSET(dva);
-		STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink)
-			if (vdev->v_id == vdevid)
-				break;
-		if (!vdev || !vdev->v_read)
-			continue;
-		if (vdev->v_read(vdev, bp, pbuf, offset, psize))
-			continue;
+		if (DVA_GET_GANG(dva)) {
+			printf("ZFS: gang block detected!\n");
+			if (zio_read_gang(spa, bp, dva, buf))
+				return (EIO); 
+		} else {
+			vdevid = DVA_GET_VDEV(dva);
+			offset = DVA_GET_OFFSET(dva);
+			STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink)
+				if (vdev->v_id == vdevid)
+					break;
+			if (!vdev || !vdev->v_read) {
+				continue;
+			}
+			if (vdev->v_read(vdev, bp, pbuf, offset, psize))
+				continue;
 
-		if (cpfunc != ZIO_COMPRESS_OFF) {
-			if (zio_decompress_data(cpfunc, pbuf, psize,
-				buf, lsize))
-				return (EIO);
+			if (cpfunc != ZIO_COMPRESS_OFF) {
+				if (zio_decompress_data(cpfunc, pbuf, psize,
+				    buf, lsize))
+					return (EIO);
+			}
 		}
 
 		return (0);
@@ -1331,13 +1367,13 @@ zfs_mount_dataset(spa_t *spa, uint64_t o
 	dsl_dataset_phys_t *ds;
 
 	if (objset_get_dnode(spa, &spa->spa_mos, objnum, &dataset)) {
-		printf("ZFS: can't find dataset %lld\n", objnum);
+		printf("ZFS: can't find dataset %llu\n", objnum);
 		return (EIO);
 	}
 
 	ds = (dsl_dataset_phys_t *) &dataset.dn_bonus;
 	if (zio_read(spa, &ds->ds_bp, objset)) {
-		printf("ZFS: can't read object set for dataset %lld\n", objnum);
+		printf("ZFS: can't read object set for dataset %llu\n", objnum);
 		return (EIO);
 	}
 
@@ -1367,7 +1403,8 @@ zfs_mount_root(spa_t *spa, objset_phys_t
 	 */
 	if (zap_lookup(spa, &dir, DMU_POOL_PROPS, &props) == 0
 	     && objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0
-	     && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0)
+	     && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0
+	     && bootfs != 0)
 		return zfs_mount_dataset(spa, bootfs, objset);
 
 	/*
@@ -1425,7 +1462,7 @@ zfs_lookup(spa_t *spa, const char *upath
 	int symlinks_followed = 0;
 
 	if (spa->spa_root_objset.os_type != DMU_OST_ZFS) {
-		printf("ZFS: unexpected object set type %lld\n",
+		printf("ZFS: unexpected object set type %llu\n",
 		       spa->spa_root_objset.os_type);
 		return (EIO);
 	}

Modified: head/sys/cddl/boot/zfs/zfsimpl.h
==============================================================================
--- head/sys/cddl/boot/zfs/zfsimpl.h	Fri Oct 23 18:41:00 2009	(r198419)
+++ head/sys/cddl/boot/zfs/zfsimpl.h	Fri Oct 23 18:44:53 2009	(r198420)
@@ -374,6 +374,24 @@ typedef struct vdev_label {
 #define	VDEV_LABEL_END_SIZE	(2 * sizeof (vdev_label_t))
 #define	VDEV_LABELS		4
 
+/*
+ * Gang block headers are self-checksumming and contain an array
+ * of block pointers.
+ */
+#define SPA_GANGBLOCKSIZE	SPA_MINBLOCKSIZE
+#define SPA_GBH_NBLKPTRS	((SPA_GANGBLOCKSIZE - \
+	sizeof (zio_block_tail_t)) / sizeof (blkptr_t))
+#define SPA_GBH_FILLER		((SPA_GANGBLOCKSIZE - \
+	sizeof (zio_block_tail_t) - \
+	(SPA_GBH_NBLKPTRS * sizeof (blkptr_t))) /\
+	sizeof (uint64_t))
+
+typedef struct zio_gbh {
+	blkptr_t		zg_blkptr[SPA_GBH_NBLKPTRS];
+	uint64_t		zg_filler[SPA_GBH_FILLER];
+	zio_block_tail_t	zg_tail;
+} zio_gbh_phys_t;
+
 enum zio_checksum {
 	ZIO_CHECKSUM_INHERIT = 0,
 	ZIO_CHECKSUM_ON,

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 18:53:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E9861065679;
	Fri, 23 Oct 2009 18:53:22 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 541848FC12;
	Fri, 23 Oct 2009 18:53:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NIrMIA069372;
	Fri, 23 Oct 2009 18:53:22 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NIrLsm069370;
	Fri, 23 Oct 2009 18:53:21 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200910231853.n9NIrLsm069370@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 23 Oct 2009 18:53:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198421 - head/sys/dev/syscons
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 18:53:22 -0000

Author: jkim
Date: Fri Oct 23 18:53:21 2009
New Revision: 198421
URL: http://svn.freebsd.org/changeset/base/198421

Log:
  Search for default 800x600 graphics mode from supported VESA mode list.
  Many video controllers do not support 800x600x24 mode any more.

Modified:
  head/sys/dev/syscons/syscons.c

Modified: head/sys/dev/syscons/syscons.c
==============================================================================
--- head/sys/dev/syscons/syscons.c	Fri Oct 23 18:44:53 2009	(r198420)
+++ head/sys/dev/syscons/syscons.c	Fri Oct 23 18:53:21 2009	(r198421)
@@ -343,17 +343,46 @@ sc_alloc_tty(int index, int devnum)
 	return (tp);
 }
 
+#ifdef SC_PIXEL_MODE
+static int
+sc_initial_mode(video_adapter_t *adp, int unit)
+{
+	video_info_t info;
+	int depth, vmode;
+	int i;
+
+	vmode = 0;
+	(void)resource_int_value("sc", unit, "vesa_mode", &vmode);
+	if (vmode < M_VESA_BASE || vmode > M_VESA_MODE_MAX)
+	    vmode = 0;
+
+	/*
+	 * If the default mode is not supported, search for an available
+	 * 800x600 graphics mode with the highest color depth.
+	 */
+	if (vmode == 0 || vidd_get_info(adp, vmode, &info) != 0) {
+	    depth = vmode = 0;
+	    for (i = M_VESA_BASE; i <= M_VESA_MODE_MAX; i++)
+		if (vidd_get_info(adp, i, &info) == 0 &&
+		    (info.vi_flags & V_INFO_GRAPHICS) != 0 &&
+		    info.vi_width == 800 && info.vi_height == 600 &&
+		    info.vi_depth > depth) {
+			vmode = i;
+			depth = info.vi_depth;
+		}
+	}
+
+	return (vmode);
+}
+#endif
+
 int
 sc_attach_unit(int unit, int flags)
 {
     sc_softc_t *sc;
     scr_stat *scp;
-#ifdef SC_PIXEL_MODE
-    video_info_t info;
-#endif
     int vc;
     struct cdev *dev;
-    unsigned int vmode = 0;
 
     flags &= ~SC_KERNEL_CONSOLE;
 
@@ -374,25 +403,24 @@ sc_attach_unit(int unit, int flags)
     if (sc_console == NULL)	/* sc_console_unit < 0 */
 	sc_console = scp;
 
-    (void)resource_int_value("sc", unit, "vesa_mode", &vmode);
-    if (vmode < M_VESA_BASE || vmode > M_VESA_MODE_MAX)
-	vmode = M_VESA_FULL_800;
-
 #ifdef SC_PIXEL_MODE
-    if ((sc->config & SC_VESAMODE)
-	&& (vidd_get_info(sc->adp, vmode, &info) == 0)) {
+    if ((sc->config & SC_VESAMODE) != 0) {
+	int vmode;
+	vmode = sc_initial_mode(sc->adp, unit);
+	if (vmode >= M_VESA_BASE) {
 #ifdef DEV_SPLASH
-	if (sc->flags & SC_SPLASH_SCRN)
-	    splash_term(sc->adp);
+	    if (sc->flags & SC_SPLASH_SCRN)
+		splash_term(sc->adp);
 #endif
-	sc_set_graphics_mode(scp, NULL, vmode);
-	sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8);
-	sc->initial_mode = vmode;
+	    sc_set_graphics_mode(scp, NULL, vmode);
+	    sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8);
+	    sc->initial_mode = vmode;
 #ifdef DEV_SPLASH
-	/* put up the splash again! */
-	if (sc->flags & SC_SPLASH_SCRN)
-    	    splash_init(sc->adp, scsplash_callback, sc);
+	    /* put up the splash again! */
+	    if (sc->flags & SC_SPLASH_SCRN)
+		splash_init(sc->adp, scsplash_callback, sc);
 #endif
+	}
     }
 #endif /* SC_PIXEL_MODE */
 

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 18:57:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA6981065692;
	Fri, 23 Oct 2009 18:57:52 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D97A38FC15;
	Fri, 23 Oct 2009 18:57:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NIvq0r069485;
	Fri, 23 Oct 2009 18:57:52 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NIvqpO069483;
	Fri, 23 Oct 2009 18:57:52 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200910231857.n9NIvqpO069483@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 23 Oct 2009 18:57:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198422 - head/sys/amd64/acpica
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 18:57:53 -0000

Author: jkim
Date: Fri Oct 23 18:57:52 2009
New Revision: 198422
URL: http://svn.freebsd.org/changeset/base/198422

Log:
  Try hiding annoying text cursor after the video controller is reset.

Modified:
  head/sys/amd64/acpica/acpi_wakecode.S

Modified: head/sys/amd64/acpica/acpi_wakecode.S
==============================================================================
--- head/sys/amd64/acpica/acpi_wakecode.S	Fri Oct 23 18:53:21 2009	(r198421)
+++ head/sys/amd64/acpica/acpi_wakecode.S	Fri Oct 23 18:57:52 2009	(r198422)
@@ -88,6 +88,11 @@ wakeup_start:
 	movb	$0, reset_video - wakeup_start
 	lcall	$0xc000, $3
 
+	/* When we reach here, int 0x10 should be ready.  Hide cursor. */
+	movb	$0x01, %ah
+	movb	$0x20, %ch
+	int	$0x10
+
 	/* Re-start in case the previous BIOS call clobbers them. */
 	jmp	wakeup_start
 1:

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 19:02:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E00781065676;
	Fri, 23 Oct 2009 19:02:53 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CF6B38FC18;
	Fri, 23 Oct 2009 19:02:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NJ2r9x069626;
	Fri, 23 Oct 2009 19:02:53 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NJ2rSY069624;
	Fri, 23 Oct 2009 19:02:53 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200910231902.n9NJ2rSY069624@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 23 Oct 2009 19:02:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198423 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 19:02:54 -0000

Author: jkim
Date: Fri Oct 23 19:02:53 2009
New Revision: 198423
URL: http://svn.freebsd.org/changeset/base/198423

Log:
  Remove a redundant byte swapping in the previous commit.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Fri Oct 23 18:57:52 2009	(r198422)
+++ head/sys/dev/fb/vesa.c	Fri Oct 23 19:02:53 2009	(r198423)
@@ -890,7 +890,6 @@ vesa_bios_init(void)
 		vmode.v_lfb = le32toh(vmode.v_lfb);
 		vmode.v_offscreen = le32toh(vmode.v_offscreen);
 		vmode.v_offscreensize = le16toh(vmode.v_offscreensize);
-		vmode.v_maxpixelclock = le32toh(vmode.v_maxpixelclock);
 		vmode.v_linbpscanline = le16toh(vmode.v_linbpscanline);
 		vmode.v_maxpixelclock = le32toh(vmode.v_maxpixelclock);
 

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 21:33:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79C72106566C;
	Fri, 23 Oct 2009 21:33:27 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 697F38FC17;
	Fri, 23 Oct 2009 21:33:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NLXRPr072734;
	Fri, 23 Oct 2009 21:33:27 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NLXRab072732;
	Fri, 23 Oct 2009 21:33:27 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <200910232133.n9NLXRab072732@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 23 Oct 2009 21:33:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198426 - head/sys/dev/siis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 21:33:27 -0000

Author: mav
Date: Fri Oct 23 21:33:26 2009
New Revision: 198426
URL: http://svn.freebsd.org/changeset/base/198426

Log:
  Reimplement device reset sequence in more controller-specific way.

Modified:
  head/sys/dev/siis/siis.c

Modified: head/sys/dev/siis/siis.c
==============================================================================
--- head/sys/dev/siis/siis.c	Fri Oct 23 19:53:04 2009	(r198425)
+++ head/sys/dev/siis/siis.c	Fri Oct 23 21:33:26 2009	(r198426)
@@ -80,7 +80,6 @@ static void siis_portinit(device_t dev);
 static int siis_wait_ready(device_t dev, int t);
 
 static int siis_sata_connect(struct siis_channel *ch);
-static int siis_sata_phy_reset(device_t dev);
 
 static void siis_issue_read_log(device_t dev);
 static void siis_process_read_log(device_t dev, union ccb *ccb);
@@ -1250,16 +1249,27 @@ siis_portinit(device_t dev)
 	siis_wait_ready(dev, 1000);
 }
 
-#if 0
-static void
+static int
 siis_devreset(device_t dev)
 {
 	struct siis_channel *ch = device_get_softc(dev);
+	int timeout = 0;
+	uint32_t val;
 
 	ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_DEV_RESET);
-	siis_wait_ready(dev, 1000);
+	while (((val = ATA_INL(ch->r_mem, SIIS_P_STS)) &
+	    SIIS_P_CTL_DEV_RESET) != 0) {
+		DELAY(1000);
+		if (timeout++ > 100) {
+			device_printf(dev, "device reset stuck (timeout %dms) "
+			    "status = %08x\n", timeout, val);
+			return (EBUSY);
+		}
+	}
+	if (bootverbose)
+		device_printf(dev, "device reset time=%dms\n", timeout);
+	return (0);
 }
-#endif
 
 static int
 siis_wait_ready(device_t dev, int t)
@@ -1287,6 +1297,7 @@ siis_reset(device_t dev)
 {
 	struct siis_channel *ch = device_get_softc(dev);
 	int i;
+	uint32_t val;
 
 	if (bootverbose)
 		device_printf(dev, "SIIS reset...\n");
@@ -1303,10 +1314,7 @@ siis_reset(device_t dev)
 		}
 		xpt_done(fccb);
 	}
-	/* Disable port interrupts */
-	ATA_OUTL(ch->r_mem, SIIS_P_IECLR, 0x0000FFFF);
-	/* Kill the engine and requeue all running commands. */
-	siis_portinit(dev);
+	/* Requeue all running commands. */
 	for (i = 0; i < SIIS_MAX_SLOTS; i++) {
 		/* Do we have a running request on slot? */
 		if (ch->slot[i].state < SIIS_SLOT_RUNNING)
@@ -1314,8 +1322,23 @@ siis_reset(device_t dev)
 		/* XXX; Commands in loading state. */
 		siis_end_transaction(&ch->slot[i], SIIS_ERR_INNOCENT);
 	}
+	/* Disable port interrupts */
+	ATA_OUTL(ch->r_mem, SIIS_P_IECLR, 0x0000FFFF);
+	/* Set speed limit. */
+	if (ch->sata_rev == 1)
+		val = ATA_SC_SPD_SPEED_GEN1;
+	else if (ch->sata_rev == 2)
+		val = ATA_SC_SPD_SPEED_GEN2;
+	else if (ch->sata_rev == 3)
+		val = ATA_SC_SPD_SPEED_GEN3;
+	else
+		val = 0;
+	ATA_OUTL(ch->r_mem, SIIS_P_SCTL,
+	    ATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 :
+	    (ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)));
+	siis_devreset(dev);
 	/* Reset and reconnect PHY, */
-	if (!siis_sata_phy_reset(dev)) {
+	if (!siis_sata_connect(ch)) {
 		ch->devices = 0;
 		/* Enable port interrupts */
 		ATA_OUTL(ch->r_mem, SIIS_P_IESET, SIIS_P_IX_ENABLED);
@@ -1327,9 +1350,8 @@ siis_reset(device_t dev)
 		return;
 	}
 	/* Wait for clearing busy status. */
-	if (siis_wait_ready(dev, 10000)) {
+	if (siis_wait_ready(dev, 10000))
 		device_printf(dev, "device ready timeout\n");
-	}
 	ch->devices = 1;
 	/* Enable port interrupts */
 	ATA_OUTL(ch->r_mem, SIIS_P_IS, 0xFFFFFFFF);
@@ -1420,32 +1442,6 @@ siis_sata_connect(struct siis_channel *c
 	return (1);
 }
 
-static int
-siis_sata_phy_reset(device_t dev)
-{
-	struct siis_channel *ch = device_get_softc(dev);
-	uint32_t val;
-
-	if (bootverbose)
-		device_printf(dev, "hardware reset ...\n");
-	ATA_OUTL(ch->r_mem, SIIS_P_SCTL, ATA_SC_IPM_DIS_PARTIAL |
-	    ATA_SC_IPM_DIS_SLUMBER | ATA_SC_DET_RESET);
-	DELAY(50000);
-	if (ch->sata_rev == 1)
-		val = ATA_SC_SPD_SPEED_GEN1;
-	else if (ch->sata_rev == 2)
-		val = ATA_SC_SPD_SPEED_GEN2;
-	else if (ch->sata_rev == 3)
-		val = ATA_SC_SPD_SPEED_GEN3;
-	else
-		val = 0;
-	ATA_OUTL(ch->r_mem, SIIS_P_SCTL,
-	    ATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 :
-	    (ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)));
-	DELAY(50000);
-	return (siis_sata_connect(ch));
-}
-
 static void
 siisaction(struct cam_sim *sim, union ccb *ccb)
 {

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 21:36:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF1FF1065670;
	Fri, 23 Oct 2009 21:36:33 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE9C68FC1E;
	Fri, 23 Oct 2009 21:36:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NLaXU9072822;
	Fri, 23 Oct 2009 21:36:33 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NLaXjS072818;
	Fri, 23 Oct 2009 21:36:33 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910232136.n9NLaXjS072818@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 23 Oct 2009 21:36:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198427 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 21:36:33 -0000

Author: nwhitehorn
Date: Fri Oct 23 21:36:33 2009
New Revision: 198427
URL: http://svn.freebsd.org/changeset/base/198427

Log:
  Add some more paranoia to setting HID registers, and update the AIM
  clock routines to work better with SMP. This makes SMP work fully and
  stably on an Xserve G5.
  
  Obtained from:	Book-E (clock bits)

Modified:
  head/sys/powerpc/aim/clock.c
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/aim/mp_cpudep.c

Modified: head/sys/powerpc/aim/clock.c
==============================================================================
--- head/sys/powerpc/aim/clock.c	Fri Oct 23 21:33:26 2009	(r198426)
+++ head/sys/powerpc/aim/clock.c	Fri Oct 23 21:36:33 2009	(r198427)
@@ -95,8 +95,7 @@ static struct timecounter	decr_timecount
 void
 decr_intr(struct trapframe *frame)
 {
-	long		tick;
-	int		nticks;
+	int32_t		tick, nticks;
 
 	/*
 	 * Check whether we are initialized.
@@ -112,13 +111,17 @@ decr_intr(struct trapframe *frame)
 	for (nticks = 0; tick < 0; nticks++)
 		tick += ticks_per_intr;
 	mtdec(tick);
+if (nticks > 5) printf("BIG NTICKS on CPU %d: %x\n",PCPU_GET(cpuid),nticks);
 
-	if (PCPU_GET(cpuid) == 0) {
-		while (nticks-- > 0)
+	while (nticks-- > 0) {
+		if (PCPU_GET(cpuid) == 0)
 			hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
-	} else {
-		while (nticks-- > 0)
+		else
 			hardclock_cpu(TRAPF_USERMODE(frame));
+
+		statclock(TRAPF_USERMODE(frame));
+		if (profprocs != 0)
+			profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
 	}
 }
 
@@ -145,6 +148,8 @@ decr_init(void)
 	ticks_per_intr = ticks_per_sec / hz;
 	mtdec(ticks_per_intr);
 
+	set_cputicker(mftb, ticks_per_sec, 0);
+
 	mtmsr(msr);
 }
 

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Fri Oct 23 21:33:26 2009	(r198426)
+++ head/sys/powerpc/aim/machdep.c	Fri Oct 23 21:36:33 2009	(r198427)
@@ -885,6 +885,8 @@ cpu_initclocks(void)
 {
 
 	decr_tc_init();
+	stathz = hz;
+	profhz = hz;
 }
 
 /*

Modified: head/sys/powerpc/aim/mp_cpudep.c
==============================================================================
--- head/sys/powerpc/aim/mp_cpudep.c	Fri Oct 23 21:33:26 2009	(r198426)
+++ head/sys/powerpc/aim/mp_cpudep.c	Fri Oct 23 21:36:33 2009	(r198427)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
 
 void *ap_pcpu;
 
-static register_t bsp_state[8];
+static register_t bsp_state[8] __aligned(8);
 
 static void cpudep_save_config(void *dummy);
 SYSINIT(cpu_save_config, SI_SUB_CPU, SI_ORDER_ANY, cpudep_save_config, NULL);
@@ -184,6 +184,8 @@ cpudep_save_config(void *dummy)
 		__asm __volatile ("mfspr %0,%2; mr %1,%0; srdi %0,%0,32"
 		    : "=r" (bsp_state[6]),"=r" (bsp_state[7]) : "K" (SPR_HID5));
 
+		powerpc_sync();
+
 		break;
 	case MPC7450:
 	case MPC7455:
@@ -224,17 +226,23 @@ cpudep_ap_setup()
 		 * See Table 2-3, 970MP manual
 		 */
 
+		__asm __volatile("mtasr %0; sync" :: "r"(0));
 		__asm __volatile(" \
 			ld	%0,0(%2);				\
+			sync; isync;					\
 			mtspr	%1, %0;					\
 			mfspr	%0, %1;	mfspr	%0, %1;	mfspr	%0, %1;	\
-			mfspr	%0, %1;	mfspr	%0, %1;	mfspr	%0, %1;"
+			mfspr	%0, %1;	mfspr	%0, %1;	mfspr	%0, %1; \
+			sync; isync" 
 		    : "=r"(reg) : "K"(SPR_HID0), "r"(bsp_state));
-		__asm __volatile("ld %0, 8(%2); mtspr %1, %0; mtspr %1, %0; \
-		    isync" : "=r"(reg) : "K"(SPR_HID1), "r"(bsp_state));
-		__asm __volatile("ld %0, 16(%2); sync; mtspr %1, %0; isync;"
+		__asm __volatile("ld %0, 8(%2); sync; isync;	\
+		    mtspr %1, %0; mtspr %1, %0; sync; isync"
+		    : "=r"(reg) : "K"(SPR_HID1), "r"(bsp_state));
+		__asm __volatile("ld %0, 16(%2); sync; isync;	\
+		    mtspr %1, %0; sync; isync;"
 		    : "=r"(reg) : "K"(SPR_HID4), "r"(bsp_state));
-		__asm __volatile("ld %0, 24(%2); sync; mtspr %1, %0; isync;"
+		__asm __volatile("ld %0, 24(%2); sync; isync;	\
+		    mtspr %1, %0; sync; isync;"
 		    : "=r"(reg) : "K"(SPR_HID5), "r"(bsp_state));
 
 		powerpc_sync();

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 21:44:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A0110106566C;
	Fri, 23 Oct 2009 21:44:46 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FE8E8FC1A;
	Fri, 23 Oct 2009 21:44:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NLik1o072997;
	Fri, 23 Oct 2009 21:44:46 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NLikI2072995;
	Fri, 23 Oct 2009 21:44:46 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910232144.n9NLikI2072995@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 23 Oct 2009 21:44:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198428 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 21:44:46 -0000

Author: nwhitehorn
Date: Fri Oct 23 21:44:46 2009
New Revision: 198428
URL: http://svn.freebsd.org/changeset/base/198428

Log:
  Remove debugging printf that snuck in here.
  
  Pointy hat to:	me

Modified:
  head/sys/powerpc/aim/clock.c

Modified: head/sys/powerpc/aim/clock.c
==============================================================================
--- head/sys/powerpc/aim/clock.c	Fri Oct 23 21:36:33 2009	(r198427)
+++ head/sys/powerpc/aim/clock.c	Fri Oct 23 21:44:46 2009	(r198428)
@@ -111,7 +111,6 @@ decr_intr(struct trapframe *frame)
 	for (nticks = 0; tick < 0; nticks++)
 		tick += ticks_per_intr;
 	mtdec(tick);
-if (nticks > 5) printf("BIG NTICKS on CPU %d: %x\n",PCPU_GET(cpuid),nticks);
 
 	while (nticks-- > 0) {
 		if (PCPU_GET(cpuid) == 0)

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 22:04:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C96A1065670;
	Fri, 23 Oct 2009 22:04:19 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EE2EE8FC08;
	Fri, 23 Oct 2009 22:04:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NM4ICY073592;
	Fri, 23 Oct 2009 22:04:18 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NM4Icf073589;
	Fri, 23 Oct 2009 22:04:18 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910232204.n9NM4Icf073589@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 23 Oct 2009 22:04:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198429 - in head/sys: contrib/dev/iwn dev/iwn
	modules/iwnfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 22:04:19 -0000

Author: rpaulo
Date: Fri Oct 23 22:04:18 2009
New Revision: 198429
URL: http://svn.freebsd.org/changeset/base/198429

Log:
  Updated iwn(4) driver supporting the newer series, 5000, 5150 and 5300.
  
  Submitted by:	Bernhard Schmidt 

Added:
  head/sys/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu
  head/sys/contrib/dev/iwn/iwlwifi-5000-5.4.A.11.fw.uu
  head/sys/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu
Deleted:
  head/sys/contrib/dev/iwn/iwlwifi-4965-4.44.17.fw.uu
Modified:
  head/sys/contrib/dev/iwn/LICENSE
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnreg.h
  head/sys/dev/iwn/if_iwnvar.h
  head/sys/modules/iwnfw/Makefile

Modified: head/sys/contrib/dev/iwn/LICENSE
==============================================================================
--- head/sys/contrib/dev/iwn/LICENSE	Fri Oct 23 21:44:46 2009	(r198428)
+++ head/sys/contrib/dev/iwn/LICENSE	Fri Oct 23 22:04:18 2009	(r198429)
@@ -1,39 +1,39 @@
-Copyright (c) 2006, Intel Corporation.
-All rights reserved.
-
-Redistribution.  Redistribution and use in binary form, without 
-modification, are permitted provided that the following conditions are 
-met:
-
-* Redistributions must reproduce the above copyright notice and the 
-  following disclaimer in the documentation and/or other materials 
-  provided with the distribution. 
-* Neither the name of Intel Corporation nor the names of its suppliers 
-  may be used to endorse or promote products derived from this software 
-  without specific prior written permission. 
-* No reverse engineering, decompilation, or disassembly of this software 
-  is permitted.
-
-Limited patent license.  Intel Corporation grants a world-wide, 
-royalty-free, non-exclusive license under patents it now or hereafter 
-owns or controls to make, have made, use, import, offer to sell and 
-sell ("Utilize") this software, but solely to the extent that any 
-such patent is necessary to Utilize the software alone, or in 
-combination with an operating system licensed under an approved Open 
-Source license as listed by the Open Source Initiative at 
-http://opensource.org/licenses.  The patent license shall not apply to 
-any other combinations which include this software.  No hardware per 
-se is licensed hereunder.
-
-DISCLAIMER.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
-OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
-TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
-USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
-DAMAGE.
+Copyright (c) 2006-2009, Intel Corporation.
+All rights reserved.
+
+Redistribution.  Redistribution and use in binary form, without 
+modification, are permitted provided that the following conditions are 
+met:
+
+* Redistributions must reproduce the above copyright notice and the 
+  following disclaimer in the documentation and/or other materials 
+  provided with the distribution. 
+* Neither the name of Intel Corporation nor the names of its suppliers 
+  may be used to endorse or promote products derived from this software 
+  without specific prior written permission. 
+* No reverse engineering, decompilation, or disassembly of this software 
+  is permitted.
+
+Limited patent license.  Intel Corporation grants a world-wide, 
+royalty-free, non-exclusive license under patents it now or hereafter 
+owns or controls to make, have made, use, import, offer to sell and 
+sell ("Utilize") this software, but solely to the extent that any 
+such patent is necessary to Utilize the software alone, or in 
+combination with an operating system licensed under an approved Open 
+Source license as listed by the Open Source Initiative at 
+http://opensource.org/licenses.  The patent license shall not apply to 
+any other combinations which include this software.  No hardware per 
+se is licensed hereunder.
+
+DISCLAIMER.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
+DAMAGE.

Added: head/sys/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu	Fri Oct 23 22:04:18 2009	(r198429)
@@ -0,0 +1,3336 @@
+Copyright (c) 2006, Intel Corporation.
+All rights reserved.
+
+Redistribution.  Redistribution and use in binary form, without 
+modification, are permitted provided that the following conditions are 
+met:
+
+* Redistributions must reproduce the above copyright notice and the 
+  following disclaimer in the documentation and/or other materials 
+  provided with the distribution. 
+* Neither the name of Intel Corporation nor the names of its suppliers 
+  may be used to endorse or promote products derived from this software 
+  without specific prior written permission. 
+* No reverse engineering, decompilation, or disassembly of this software 
+  is permitted.
+
+Limited patent license.  Intel Corporation grants a world-wide, 
+royalty-free, non-exclusive license under patents it now or hereafter 
+owns or controls to make, have made, use, import, offer to sell and 
+sell ("Utilize") this software, but solely to the extent that any 
+such patent is necessary to Utilize the software alone, or in 
+combination with an operating system licensed under an approved Open 
+Source license as listed by the Open Source Initiative at 
+http://opensource.org/licenses.  The patent license shall not apply to 
+any other combinations which include this software.  No hardware per 
+se is licensed hereunder.
+
+DISCLAIMER.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
+DAMAGE.
+begin-base64 644 iwlwifi-4965-228.57.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n/2AeliQMP+vHA4cXPdYAArA8lhRa4
+ANoEIYEPwP8AADhgliAIAM9xAADow2YJb/8T210DL/oHpfHAz3GAAKwPBoGA4BL0AdgGoQDYBaHb
+/4oghw4KCq/6iiHODkzKg+DKICEFpA/B/9HA4H7xwKoKL/qKIMcPpMHmCa/6iiGRCDYNQASA4PAO

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Oct 23 22:53:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E1ADF106566C;
	Fri, 23 Oct 2009 22:53:01 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D0F638FC14;
	Fri, 23 Oct 2009 22:53:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NMr1eK074586;
	Fri, 23 Oct 2009 22:53:01 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NMr10R074584;
	Fri, 23 Oct 2009 22:53:01 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910232253.n9NMr10R074584@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 23 Oct 2009 22:53:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198431 - head/sys/dev/pci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 23 Oct 2009 22:53:02 -0000

Author: marcel
Date: Fri Oct 23 22:53:01 2009
New Revision: 198431
URL: http://svn.freebsd.org/changeset/base/198431

Log:
  BIOSes, buggy or otherwise, are i386 or amd64 specific.
  Have the early USB takeover enabled for i386 and amd64
  by default.
  This also avoids a panic on PowerPC where the resource
  isn't released properly and we find a busy resource
  when the USB host controller wants to allocate it...

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Fri Oct 23 22:07:34 2009	(r198430)
+++ head/sys/dev/pci/pci.c	Fri Oct 23 22:53:01 2009	(r198431)
@@ -274,7 +274,11 @@ TUNABLE_INT("hw.pci.honor_msi_blacklist"
 SYSCTL_INT(_hw_pci, OID_AUTO, honor_msi_blacklist, CTLFLAG_RD,
     &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI");
 
+#if defined(__i386__) || defined(__amd64__)
 static int pci_usb_takeover = 1;
+#else
+static int pci_usb_takeover = 0;
+#endif
 TUNABLE_INT("hw.pci.usb_early_takeover", &pci_usb_takeover);
 SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RD | CTLFLAG_TUN,
     &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 01:58:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FF9A106566C;
	Sat, 24 Oct 2009 01:58:10 +0000 (UTC)
	(envelope-from jkoshy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7DF4C8FC1B;
	Sat, 24 Oct 2009 01:58:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9O1wAlA077987;
	Sat, 24 Oct 2009 01:58:10 GMT (envelope-from jkoshy@svn.freebsd.org)
Received: (from jkoshy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9O1wANG077985;
	Sat, 24 Oct 2009 01:58:10 GMT (envelope-from jkoshy@svn.freebsd.org)
Message-Id: <200910240158.n9O1wANG077985@svn.freebsd.org>
From: Joseph Koshy 
Date: Sat, 24 Oct 2009 01:58:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198432 - head/sys/dev/hwpmc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 01:58:10 -0000

Author: jkoshy
Date: Sat Oct 24 01:58:10 2009
New Revision: 198432
URL: http://svn.freebsd.org/changeset/base/198432

Log:
  Only claim that the PMC_CLASS_IAF PMCs are supported by a CPU if
  there are PMCs on the CPU that belong to the class.
  
  Review and testing by:	fabient

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_core.c	Fri Oct 23 22:53:01 2009	(r198431)
+++ head/sys/dev/hwpmc/hwpmc_core.c	Sat Oct 24 01:58:10 2009	(r198432)
@@ -1977,11 +1977,21 @@ pmc_core_initialize(struct pmc_mdep *md,
 		core_iaf_npmc = cpuid[CORE_CPUID_EDX] & 0x1F;
 		core_iaf_width = (cpuid[CORE_CPUID_EDX] >> 5) & 0xFF;
 
-		iaf_initialize(md, maxcpu, core_iaf_npmc, core_iaf_width);
-
-		core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) <<
-		    IAF_OFFSET;
-
+		if (core_iaf_npmc > 0) {
+			iaf_initialize(md, maxcpu, core_iaf_npmc,
+			    core_iaf_width);
+			core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) <<
+			    IAF_OFFSET;
+		} else {
+			/*
+			 * Adjust the number of classes exported to
+			 * user space.
+			 */
+			md->pmd_nclass--;
+			KASSERT(md->pmd_nclass == 2,
+			    ("[core,%d] unexpected nclass %d", __LINE__,
+				md->pmd_nclass));
+		}
 	}
 
 	PMCDBG(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask,

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 04:11:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39F571065670;
	Sat, 24 Oct 2009 04:11:41 +0000 (UTC)
	(envelope-from jkoshy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F5778FC17;
	Sat, 24 Oct 2009 04:11:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9O4Bfxk080759;
	Sat, 24 Oct 2009 04:11:41 GMT (envelope-from jkoshy@svn.freebsd.org)
Received: (from jkoshy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9O4BfhQ080757;
	Sat, 24 Oct 2009 04:11:41 GMT (envelope-from jkoshy@svn.freebsd.org)
Message-Id: <200910240411.n9O4BfhQ080757@svn.freebsd.org>
From: Joseph Koshy 
Date: Sat, 24 Oct 2009 04:11:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198433 - head/lib/libpmc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 04:11:41 -0000

Author: jkoshy
Date: Sat Oct 24 04:11:40 2009
New Revision: 198433
URL: http://svn.freebsd.org/changeset/base/198433

Log:
  Not all Intel Core (TM) CPUs implement PMC_CLASS_IAF fixed-function
  counters.  For such CPUs, use an alternate mapping of convenience
  names to events supported by PMC_CLASS_IAP programmable counters.
  
  Testing and review by:	fabient

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==============================================================================
--- head/lib/libpmc/libpmc.c	Sat Oct 24 01:58:10 2009	(r198432)
+++ head/lib/libpmc/libpmc.c	Sat Oct 24 04:11:40 2009	(r198433)
@@ -442,6 +442,10 @@ static struct pmc_event_alias core_alias
 /*
  * Intel Core2 (Family 6, Model F), Core2Extreme (Family 6, Model 17H)
  * and Atom (Family 6, model 1CH) PMCs.
+ *
+ * We map aliases to events on the fixed-function counters if these
+ * are present.  Note that not all CPUs in this family contain fixed-function
+ * counters.
  */
 
 static struct pmc_event_alias core2_aliases[] = {
@@ -454,8 +458,22 @@ static struct pmc_event_alias core2_alia
 	EV_ALIAS("unhalted-cycles",	"iaf-cpu-clk-unhalted.core"),
 	EV_ALIAS(NULL, NULL)
 };
-#define	atom_aliases	core2_aliases
-#define corei7_aliases	core2_aliases
+
+static struct pmc_event_alias core2_aliases_without_iaf[] = {
+	EV_ALIAS("branches",		"iap-br-inst-retired.any"),
+	EV_ALIAS("branch-mispredicts",	"iap-br-inst-retired.mispred"),
+	EV_ALIAS("cycles",		"tsc-tsc"),
+	EV_ALIAS("ic-misses",		"iap-l1i-misses"),
+	EV_ALIAS("instructions",	"iap-inst-retired.any_p"),
+	EV_ALIAS("interrupts",		"iap-hw-int-rcv"),
+	EV_ALIAS("unhalted-cycles",	"iap-cpu-clk-unhalted.core_p"),
+	EV_ALIAS(NULL, NULL)
+};
+
+#define	atom_aliases			core2_aliases
+#define	atom_aliases_without_iaf	core2_aliases_without_iaf
+#define corei7_aliases			core2_aliases
+#define corei7_aliases_without_iaf	core2_aliases_without_iaf
 
 #define	IAF_KW_OS		"os"
 #define	IAF_KW_USR		"usr"
@@ -2379,6 +2397,10 @@ pmc_init(void)
 	uint32_t abi_version;
 	struct module_stat pmc_modstat;
 	struct pmc_op_getcpuinfo op_cpu_info;
+#if defined(__amd64__) || defined(__i386__)
+	int cpu_has_iaf_counters;
+	unsigned int t;
+#endif
 
 	if (pmc_syscall != -1) /* already inited */
 		return (0);
@@ -2420,6 +2442,8 @@ pmc_init(void)
 	if (pmc_class_table == NULL)
 		return (-1);
 
+	for (n = 0; n < PMC_CLASS_TABLE_SIZE; n++)
+		pmc_class_table[n] = NULL;
 
 	/*
 	 * Fill in the class table.
@@ -2427,6 +2451,14 @@ pmc_init(void)
 	n = 0;
 #if defined(__amd64__) || defined(__i386__)
 	pmc_class_table[n++] = &tsc_class_table_descr;
+
+	/*
+ 	 * Check if this CPU has fixed function counters.
+	 */
+	cpu_has_iaf_counters = 0;
+	for (t = 0; t < cpu_info.pm_nclass; t++)
+		if (cpu_info.pm_classes[t].pm_class == PMC_CLASS_IAF)
+			cpu_has_iaf_counters = 1;
 #endif
 
 #define	PMC_MDEP_INIT(C) do {					\
@@ -2436,6 +2468,16 @@ pmc_init(void)
 		    PMC_TABLE_SIZE(C##_pmc_classes);		\
 	} while (0)
 
+#define	PMC_MDEP_INIT_INTEL_V2(C) do {					\
+		PMC_MDEP_INIT(C);					\
+		if (cpu_has_iaf_counters) 				\
+			pmc_class_table[n++] = &iaf_class_table_descr;	\
+		else							\
+			pmc_mdep_event_aliases =			\
+				C##_aliases_without_iaf;		\
+		pmc_class_table[n] = &C##_class_table_descr;		\
+	} while (0)
+
 	/* Configure the event name parser. */
 	switch (cpu_info.pm_cputype) {
 #if defined(__i386__)
@@ -2461,24 +2503,17 @@ pmc_init(void)
 		pmc_class_table[n] = &k8_class_table_descr;
 		break;
 	case PMC_CPU_INTEL_ATOM:
-		PMC_MDEP_INIT(atom);
-		pmc_class_table[n++] = &iaf_class_table_descr;
-		pmc_class_table[n]   = &atom_class_table_descr;
+		PMC_MDEP_INIT_INTEL_V2(atom);
 		break;
 	case PMC_CPU_INTEL_CORE:
 		PMC_MDEP_INIT(core);
-		pmc_class_table[n] = &core_class_table_descr;
 		break;
 	case PMC_CPU_INTEL_CORE2:
 	case PMC_CPU_INTEL_CORE2EXTREME:
-		PMC_MDEP_INIT(core2);
-		pmc_class_table[n++] = &iaf_class_table_descr;
-		pmc_class_table[n]   = &core2_class_table_descr;
+		PMC_MDEP_INIT_INTEL_V2(core2);
 		break;
 	case PMC_CPU_INTEL_COREI7:
-		PMC_MDEP_INIT(corei7);
-		pmc_class_table[n++] = &iaf_class_table_descr;
-		pmc_class_table[n]   = &corei7_class_table_descr;
+		PMC_MDEP_INIT_INTEL_V2(corei7);
 		break;
 	case PMC_CPU_INTEL_PIV:
 		PMC_MDEP_INIT(p4);

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 09:18:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4A44106568D;
	Sat, 24 Oct 2009 09:18:26 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D3EE78FC1A;
	Sat, 24 Oct 2009 09:18:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9O9IQcq086345;
	Sat, 24 Oct 2009 09:18:26 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9O9IQBT086343;
	Sat, 24 Oct 2009 09:18:26 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200910240918.n9O9IQBT086343@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 24 Oct 2009 09:18:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198438 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 09:18:27 -0000

Author: rwatson
Date: Sat Oct 24 09:18:26 2009
New Revision: 198438
URL: http://svn.freebsd.org/changeset/base/198438

Log:
  Correct spelling typo in ip_input comment.
  
  Pointed out by:	N.J. Mann ,
  		John Nielsen , julian (!), lstewart
  MFC after:	2 days

Modified:
  head/sys/netinet/ip_input.c

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Sat Oct 24 08:25:43 2009	(r198437)
+++ head/sys/netinet/ip_input.c	Sat Oct 24 09:18:26 2009	(r198438)
@@ -531,7 +531,7 @@ tooshort:
 	if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) {
 		/*
 		 * Directly ship the packet on.  This allows forwarding
-		 * packets originally destined to us to ome other directly
+		 * packets originally destined to us to some other directly
 		 * connected host.
 		 */
 		ip_forward(m, dchg);

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 09:55:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A7FA10656CA;
	Sat, 24 Oct 2009 09:55:12 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 275758FC14;
	Sat, 24 Oct 2009 09:55:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9O9tC9c087122;
	Sat, 24 Oct 2009 09:55:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9O9tCXP087115;
	Sat, 24 Oct 2009 09:55:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910240955.n9O9tCXP087115@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 24 Oct 2009 09:55:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198439 - in head/sys: dev/iwn modules/iwnfw
	modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn5150
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 09:55:12 -0000

Author: rpaulo
Date: Sat Oct 24 09:55:11 2009
New Revision: 198439
URL: http://svn.freebsd.org/changeset/base/198439

Log:
  Updates to the iwn driver:
  * iwnfw has now been split into individual modules so autoloading of
    firmware module(s) does work again.
  * Changes have been made to RUN -> AUTH transition, this should fix the
    issue reported by Glen and others.
  * Brandon reported issues in iwn_cmd() with large commands, those have
    been fixed to.
  * DEAUTH is now handled correctly.
  
  Submitted by:	Bernhard Schmidt 

Added:
  head/sys/modules/iwnfw/Makefile.inc   (contents, props changed)
  head/sys/modules/iwnfw/iwn4965/
  head/sys/modules/iwnfw/iwn4965/Makefile   (contents, props changed)
  head/sys/modules/iwnfw/iwn5000/
  head/sys/modules/iwnfw/iwn5000/Makefile   (contents, props changed)
  head/sys/modules/iwnfw/iwn5150/
  head/sys/modules/iwnfw/iwn5150/Makefile   (contents, props changed)
Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/modules/iwnfw/Makefile

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c	Sat Oct 24 09:18:26 2009	(r198438)
+++ head/sys/dev/iwn/if_iwn.c	Sat Oct 24 09:55:11 2009	(r198439)
@@ -601,7 +601,7 @@ iwn_hal_attach(struct iwn_softc *sc)
 	switch (sc->hw_type) {
 	case IWN_HW_REV_TYPE_4965:
 		sc->sc_hal = &iwn4965_hal;
-		sc->fwname = "iwnfw-4965";
+		sc->fwname = "iwn4965fw";
 		sc->critical_temp = IWN_CTOK(110);
 		sc->txantmsk = IWN_ANT_A | IWN_ANT_B;
 		sc->rxantmsk = IWN_ANT_ABC;
@@ -610,7 +610,7 @@ iwn_hal_attach(struct iwn_softc *sc)
 		break;
 	case IWN_HW_REV_TYPE_5100:
 		sc->sc_hal = &iwn5000_hal;
-		sc->fwname = "iwnfw-5000";
+		sc->fwname = "iwn5000fw";
 		sc->critical_temp = 110;
 		sc->txantmsk = IWN_ANT_B;
 		sc->rxantmsk = IWN_ANT_A | IWN_ANT_B;
@@ -619,7 +619,7 @@ iwn_hal_attach(struct iwn_softc *sc)
 		break;
 	case IWN_HW_REV_TYPE_5150:
 		sc->sc_hal = &iwn5000_hal;
-		sc->fwname = "iwnfw-5150";
+		sc->fwname = "iwn5150fw";
 		/* NB: critical temperature will be read from EEPROM. */
 		sc->txantmsk = IWN_ANT_A;
 		sc->rxantmsk = IWN_ANT_A | IWN_ANT_B;
@@ -629,14 +629,14 @@ iwn_hal_attach(struct iwn_softc *sc)
 	case IWN_HW_REV_TYPE_5300:
 	case IWN_HW_REV_TYPE_5350:
 		sc->sc_hal = &iwn5000_hal;
-		sc->fwname = "iwnfw-5000";
+		sc->fwname = "iwn5000fw";
 		sc->critical_temp = 110;
 		sc->txantmsk = sc->rxantmsk = IWN_ANT_ABC;
 		sc->ntxchains = sc->nrxchains = 3;
 		break;
 	case IWN_HW_REV_TYPE_1000:
 		sc->sc_hal = &iwn5000_hal;
-		sc->fwname = "iwnfw-1000";
+		sc->fwname = "iwn1000fw";
 		sc->critical_temp = 110;
 		sc->txantmsk = IWN_ANT_A;
 		sc->rxantmsk = IWN_ANT_A | IWN_ANT_B;
@@ -645,7 +645,7 @@ iwn_hal_attach(struct iwn_softc *sc)
 		break;
 	case IWN_HW_REV_TYPE_6000:
 		sc->sc_hal = &iwn5000_hal;
-		sc->fwname = "iwnfw-6000";
+		sc->fwname = "iwn6000fw";
 		sc->critical_temp = 110;
 		sc->txantmsk = IWN_ANT_ABC;
 		sc->rxantmsk = IWN_ANT_ABC;
@@ -654,7 +654,7 @@ iwn_hal_attach(struct iwn_softc *sc)
 		break;
 	case IWN_HW_REV_TYPE_6050:
 		sc->sc_hal = &iwn5000_hal;
-		sc->fwname = "iwnfw-6050";
+		sc->fwname = "iwn6050fw";
 		sc->critical_temp = 110;
 		sc->txantmsk = IWN_ANT_ABC;
 		sc->rxantmsk = IWN_ANT_ABC;
@@ -1150,7 +1150,6 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, 
 	 */
 	for (i = 0; i < IWN_RX_RING_COUNT; i++) {
 		struct iwn_rx_data *data = &ring->data[i];
-		struct mbuf *m;
 		bus_addr_t paddr;
 
 		error = bus_dmamap_create(ring->desc_dma.tag, 0, &data->map);
@@ -1161,8 +1160,8 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, 
 			goto fail;
 		}
 
-		m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE);
-		if (m == NULL) {
+		data->m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE);
+		if (data->m == NULL) {
 			device_printf(sc->sc_dev,
 			   "%s: could not allocate rx mbuf\n", __func__);
 			error = ENOMEM;
@@ -1171,20 +1170,16 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, 
 
 		/* Map page. */
 		error = bus_dmamap_load(ring->desc_dma.tag, data->map,
-		    mtod(m, caddr_t), MJUMPAGESIZE,
+		    mtod(data->m, caddr_t), MJUMPAGESIZE,
 		    iwn_dma_map_addr, &paddr, BUS_DMA_NOWAIT);
 		if (error != 0 && error != EFBIG) {
 			device_printf(sc->sc_dev,
 			    "%s: bus_dmamap_load failed, error %d\n",
 			    __func__, error);
-			m_freem(m);
+			m_freem(data->m);
 			error = ENOMEM;	/* XXX unique code */
 			goto fail;
 		}
-		bus_dmamap_sync(ring->desc_dma.tag, data->map,
-		    BUS_DMASYNC_PREWRITE);
-
-		data->m = m;
 
 		/* Set physical address of RX buffer (256-byte aligned). */
 		ring->desc[i] = htole32(paddr >> 8);
@@ -1233,6 +1228,8 @@ iwn_free_rx_ring(struct iwn_softc *sc, s
 		struct iwn_rx_data *data = &ring->data[i];
 
 		if (data->m != NULL) {
+			bus_dmamap_sync(ring->desc_dma.tag, data->map,
+			    BUS_DMASYNC_POSTREAD);
 			bus_dmamap_unload(ring->desc_dma.tag, data->map);
 			m_freem(data->m);
 		}
@@ -1304,8 +1301,6 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, 
 			    __func__, error);
 			goto fail;
 		}
-		bus_dmamap_sync(ring->desc_dma.tag, data->map,
-		    BUS_DMASYNC_PREWRITE);
 	}
 	return 0;
 fail:
@@ -1322,6 +1317,8 @@ iwn_reset_tx_ring(struct iwn_softc *sc, 
 		struct iwn_tx_data *data = &ring->data[i];
 
 		if (data->m != NULL) {
+			bus_dmamap_sync(ring->desc_dma.tag, data->map,
+			    BUS_DMASYNC_POSTWRITE);
 			bus_dmamap_unload(ring->desc_dma.tag, data->map);
 			m_freem(data->m);
 			data->m = NULL;
@@ -1329,6 +1326,8 @@ iwn_reset_tx_ring(struct iwn_softc *sc, 
 	}
 	/* Clear TX descriptors. */
 	memset(ring->desc, 0, ring->desc_dma.size);
+	bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map,
+	    BUS_DMASYNC_PREWRITE);
 	sc->qfullmsk &= ~(1 << ring->qid);
 	ring->queued = 0;
 	ring->cur = 0;
@@ -1347,7 +1346,10 @@ iwn_free_tx_ring(struct iwn_softc *sc, s
 			struct iwn_tx_data *data = &ring->data[i];
 
 			if (data->m != NULL) {
-				bus_dmamap_unload(ring->desc_dma.tag, data->map);
+				bus_dmamap_sync(ring->desc_dma.tag, data->map,
+				     BUS_DMASYNC_POSTWRITE);
+				bus_dmamap_unload(ring->desc_dma.tag,
+				    data->map);
 				m_freem(data->m);
 			}
 		}
@@ -1709,10 +1711,11 @@ iwn_newstate(struct ieee80211vap *vap, e
 
 	if (nstate == IEEE80211_S_AUTH && vap->iv_state != IEEE80211_S_AUTH) {
 		/* !AUTH -> AUTH requires adapter config */
-		error = 1;
-		while (error) {
-			error = iwn_auth(sc, vap);
-		}
+		/* Reset state to handle reassociations correctly. */
+		sc->rxon.associd = 0;
+		sc->rxon.filter &= ~htole32(IWN_FILTER_BSS);
+		iwn_calib_reset(sc);
+		error = iwn_auth(sc, vap);
 	}
 	if (nstate == IEEE80211_S_RUN && vap->iv_state != IEEE80211_S_RUN) {
 		/*
@@ -1832,6 +1835,8 @@ iwn_rx_done(struct iwn_softc *sc, struct
 	} else
 		stat = (struct iwn_rx_stat *)(desc + 1);
 
+	bus_dmamap_sync(ring->desc_dma.tag, data->map, BUS_DMASYNC_POSTREAD);
+
 	if (stat->cfg_phy_len > IWN_STAT_MAXLEN) {
 		device_printf(sc->sc_dev,
 		    "%s: invalid rx statistic header, len %d\n",
@@ -2054,7 +2059,6 @@ iwn4965_tx_done(struct iwn_softc *sc, st
 	    __func__, desc->qid, desc->idx, stat->retrycnt,
 	    stat->killcnt, stat->rate, le16toh(stat->duration),
 	    le32toh(stat->status));
-
 	iwn_tx_done(sc, desc, stat->retrycnt, le32toh(stat->status) & 0xff);
 }
 
@@ -2072,7 +2076,6 @@ iwn5000_tx_done(struct iwn_softc *sc, st
 
 	/* Reset TX scheduler slot. */
 	iwn5000_reset_sched(sc, desc->qid & 0xf, desc->idx);
-
 	iwn_tx_done(sc, desc, stat->retrycnt, le16toh(stat->status) & 0xff);
 }
 
@@ -2151,11 +2154,13 @@ iwn_cmd_done(struct iwn_softc *sc, struc
 
 	/* If the command was mapped in an mbuf, free it. */
 	if (data->m != NULL) {
+		bus_dmamap_sync(ring->desc_dma.tag, data->map,
+		    BUS_DMASYNC_POSTWRITE);
 		bus_dmamap_unload(ring->desc_dma.tag, data->map);
 		m_freem(data->m);
 		data->m = NULL;
 	}
-	wakeup(&ring->cmd[desc->idx]);
+	wakeup(&ring->desc[desc->idx]);
 }
 
 /*
@@ -2183,7 +2188,7 @@ iwn_notif_intr(struct iwn_softc *sc)
 
 		DPRINTF(sc, IWN_DEBUG_RECV,
 		    "%s: qid %x idx %d flags %x type %d(%s) len %d\n",
-		    __func__, desc->qid /*& 0xf*/, desc->idx, desc->flags,
+		    __func__, desc->qid & 0xf, desc->idx, desc->flags,
 		    desc->type, iwn_intr_str(desc->type),
 		    le16toh(desc->len));
 
@@ -2217,10 +2222,8 @@ iwn_notif_intr(struct iwn_softc *sc)
 			    (struct iwn_beacon_missed *)(desc + 1);
 			int misses = le32toh(miss->consecutive);
 
-			/* XXX not sure why we're notified w/ zero */
-			if (misses == 0)
-				break;
-
+			bus_dmamap_sync(sc->rxq.stat_dma.tag, data->map,
+			    BUS_DMASYNC_PREWRITE);
 			DPRINTF(sc, IWN_DEBUG_STATE,
 			    "%s: beacons missed %d/%d\n", __func__,
 			    misses, le32toh(miss->total));
@@ -2241,7 +2244,8 @@ iwn_notif_intr(struct iwn_softc *sc)
 			    (struct iwn_ucode_info *)(desc + 1);
 
 			/* The microcontroller is ready. */
-
+			bus_dmamap_sync(sc->rxq.stat_dma.tag, data->map,
+			    BUS_DMASYNC_PREWRITE);
 			DPRINTF(sc, IWN_DEBUG_RESET,
 			    "microcode alive notification version=%d.%d "
 			    "subtype=%x alive=%x\n", uc->major, uc->minor,
@@ -2269,7 +2273,8 @@ iwn_notif_intr(struct iwn_softc *sc)
 			 * noted. However, we handle this in iwn_intr as we
 			 * get both the enable/disble intr.
 			 */
-
+			bus_dmamap_sync(sc->rxq.stat_dma.tag, data->map,
+			    BUS_DMASYNC_PREWRITE);
 			DPRINTF(sc, IWN_DEBUG_INTR, "state changed to %x\n",
 			    le32toh(*status));
 			break;
@@ -2279,6 +2284,8 @@ iwn_notif_intr(struct iwn_softc *sc)
 			struct iwn_start_scan *scan =
 			    (struct iwn_start_scan *)(desc + 1);
 
+			bus_dmamap_sync(sc->rxq.stat_dma.tag, data->map,
+			    BUS_DMASYNC_PREWRITE);
 			DPRINTF(sc, IWN_DEBUG_ANY,
 			    "%s: scanning channel %d status %x\n",
 			    __func__, scan->chan, le32toh(scan->status));
@@ -2289,6 +2296,8 @@ iwn_notif_intr(struct iwn_softc *sc)
 			struct iwn_stop_scan *scan =
 			    (struct iwn_stop_scan *)(desc + 1);
 
+			bus_dmamap_sync(sc->rxq.stat_dma.tag, data->map,
+			    BUS_DMASYNC_PREWRITE);
 			DPRINTF(sc, IWN_DEBUG_STATE,
 			    "scan finished nchan=%d status=%d chan=%d\n",
 			    scan->nchan, scan->status, scan->chan);
@@ -2494,8 +2503,13 @@ iwn4965_update_sched(struct iwn_softc *s
 	uint16_t *w = &sc->sched[qid * IWN4965_SCHED_COUNT + idx];
 
 	*w = htole16(len + 8);
-	if (idx < IWN4965_SCHEDSZ)
+	bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map,
+	    BUS_DMASYNC_PREWRITE);
+	if (idx < IWN4965_SCHEDSZ) {
 		*(w + IWN_TX_RING_COUNT) = *w;
+		bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map,
+		    BUS_DMASYNC_PREWRITE);
+	}
 }
 
 void
@@ -2505,8 +2519,14 @@ iwn5000_update_sched(struct iwn_softc *s
 	uint16_t *w = &sc->sched[qid * IWN5000_SCHED_COUNT + idx];
 
 	*w = htole16(id << 12 | (len + 8));
-	if (idx < IWN_SCHED_WINSZ)
+
+	bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map,
+	    BUS_DMASYNC_PREWRITE);
+	if (idx < IWN_SCHED_WINSZ) {
 		*(w + IWN_TX_RING_COUNT) = *w;
+		bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map,
+		    BUS_DMASYNC_PREWRITE);
+	}
 }
 
 void
@@ -2515,8 +2535,13 @@ iwn5000_reset_sched(struct iwn_softc *sc
 	uint16_t *w = &sc->sched[qid * IWN5000_SCHED_COUNT + idx];
 
 	*w = (*w & htole16(0xf000)) | htole16(1);
-	if (idx < IWN_SCHED_WINSZ)
+	bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map,
+	    BUS_DMASYNC_PREWRITE);
+	if (idx < IWN_SCHED_WINSZ) {
 		*(w + IWN_TX_RING_COUNT) = *w;
+		bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map,
+		     BUS_DMASYNC_PREWRITE);
+	}
 }
 
 /* Determine if a given rate is CCK or OFDM. */
@@ -3104,26 +3129,49 @@ iwn_cmd(struct iwn_softc *sc, int code, 
 	struct iwn_tx_desc *desc;
 	struct iwn_tx_data *data;
 	struct iwn_tx_cmd *cmd;
+	struct mbuf *m;
 	bus_addr_t paddr;
-	int totlen;
+	int totlen, error;
 
 	IWN_LOCK_ASSERT(sc);
 
-	KASSERT(size <= sizeof cmd->data, ("Command too big"));
-
 	desc = &ring->desc[ring->cur];
 	data = &ring->data[ring->cur];
-	cmd = &ring->cmd[ring->cur];
 	totlen = 4 + size;
 
+	if (size > sizeof cmd->data) {
+		/* Command is too large to fit in a descriptor. */
+		if (totlen > MCLBYTES)
+			return EINVAL;
+		MGETHDR(m, M_DONTWAIT, MT_DATA);
+		if (m == NULL)
+			return ENOMEM;
+		if (totlen > MHLEN) {
+			MCLGET(m, M_DONTWAIT);
+			if (!(m->m_flags & M_EXT)) {
+				m_freem(m);
+				return ENOMEM;
+			}
+		}
+		cmd = mtod(m, struct iwn_tx_cmd *);
+		error = bus_dmamap_load(ring->cmd_dma.tag, data->map, cmd,
+		    totlen, iwn_dma_map_addr, &paddr, BUS_DMA_NOWAIT);
+		if (error != 0) {
+			m_freem(m);
+			return error;
+		}
+		data->m = m;
+	} else {
+		cmd = &ring->cmd[ring->cur];
+		paddr = data->cmd_paddr;
+	}
+
 	cmd->code = code;
 	cmd->flags = 0;
 	cmd->qid = ring->qid;
 	cmd->idx = ring->cur;
 	memcpy(cmd->data, buf, size);
 
-	paddr = data->cmd_paddr;
-
 	desc->nsegs = 1;
 	desc->segs[0].addr = htole32(IWN_LOADDR(paddr));
 	desc->segs[0].len  = htole16(IWN_HIADDR(paddr) | totlen << 4);
@@ -3132,6 +3180,16 @@ iwn_cmd(struct iwn_softc *sc, int code, 
 	    __func__, iwn_intr_str(cmd->code), cmd->code,
 	    cmd->flags, cmd->qid, cmd->idx);
 
+	if (size > sizeof cmd->data) {
+		bus_dmamap_sync(ring->cmd_dma.tag, data->map,
+		    BUS_DMASYNC_PREWRITE);
+	} else {
+		bus_dmamap_sync(ring->cmd_dma.tag, ring->cmd_dma.map,
+		    BUS_DMASYNC_PREWRITE);
+	}
+	bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map,
+	    BUS_DMASYNC_PREWRITE);
+
 	/* Update TX scheduler. */
 	hal->update_sched(sc, ring->qid, ring->cur, 0, 0);
 
@@ -3139,7 +3197,7 @@ iwn_cmd(struct iwn_softc *sc, int code, 
 	ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT;
 	IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur);
 
-	return async ? 0 : msleep(cmd, &sc->sc_mtx, PCATCH, "iwncmd", hz);
+	return async ? 0 : msleep(desc, &sc->sc_mtx, PCATCH, "iwncmd", hz);
 }
 
 int
@@ -3876,11 +3934,12 @@ iwn_tune_sensitivity(struct iwn_softc *s
 	struct iwn_calib_state *calib = &sc->calib;
 	uint32_t val, rxena, fa;
 	uint32_t energy[3], energy_min;
-	int i, needs_update = 0;
 	uint8_t noise[3], noise_ref;
+	int i, needs_update = 0;
 
 	/* Check that we've been enabled long enough. */
-	if ((rxena = le32toh(stats->general.load)) == 0)
+	rxena = le32toh(stats->general.load);
+	if (rxena == 0)
 		return;
 
 	/* Compute number of false alarms since last call for OFDM. */
@@ -4810,8 +4869,10 @@ iwn4965_load_firmware(struct iwn_softc *
 
 	/* Copy initialization sections into pre-allocated DMA-safe memory. */
 	memcpy(dma->vaddr, fw->init.data, fw->init.datasz);
+	bus_dmamap_sync(sc->fw_dma.tag, dma->map, BUS_DMASYNC_PREWRITE);
 	memcpy(dma->vaddr + IWN4965_FW_DATA_MAXSZ,
 	    fw->init.text, fw->init.textsz);
+	bus_dmamap_sync(sc->fw_dma.tag, dma->map, BUS_DMASYNC_PREWRITE);
 
 	/* Tell adapter where to find initialization sections. */
 	error = iwn_nic_lock(sc);
@@ -4849,8 +4910,10 @@ iwn4965_load_firmware(struct iwn_softc *
 
 	/* Copy runtime sections into pre-allocated DMA-safe memory. */
 	memcpy(dma->vaddr, fw->main.data, fw->main.datasz);
+	bus_dmamap_sync(sc->fw_dma.tag, dma->map, BUS_DMASYNC_PREWRITE);
 	memcpy(dma->vaddr + IWN4965_FW_DATA_MAXSZ,
 	    fw->main.text, fw->main.textsz);
+	bus_dmamap_sync(sc->fw_dma.tag, dma->map, BUS_DMASYNC_PREWRITE);
 
 	/* Tell adapter where to find runtime sections. */
 	error = iwn_nic_lock(sc);
@@ -4877,6 +4940,7 @@ iwn5000_load_firmware_section(struct iwn
 
 	/* Copy firmware section into pre-allocated DMA-safe memory. */
 	memcpy(dma->vaddr, section, size);
+	bus_dmamap_sync(sc->fw_dma.tag, dma->map, BUS_DMASYNC_PREWRITE);
 
 	error = iwn_nic_lock(sc);
 	if (error != 0)

Modified: head/sys/modules/iwnfw/Makefile
==============================================================================
--- head/sys/modules/iwnfw/Makefile	Sat Oct 24 09:18:26 2009	(r198438)
+++ head/sys/modules/iwnfw/Makefile	Sat Oct 24 09:55:11 2009	(r198439)
@@ -1,23 +1,5 @@
 # $FreeBSD$
 
-FWDIR=	${.CURDIR}/../../contrib/dev/iwn
-.PATH: ${FWDIR}
+SUBDIR=	iwn4965 iwn5000 iwn5150
 
-KMOD=	iwnfw
-FIRMWS=	iwlwifi-4965-228.57.2.23.fw:iwnfw-4965:22857223 \
-	iwlwifi-5000-5.4.A.11.fw:iwnfw-5000:54A11 \
-	iwlwifi-5150-8.24.2.2.fw:iwnfw-5150:82422
-
-CLEANFILES=	iwlwifi-4965-228.57.2.23.fw iwlwifi-5000-5.4.A.11.fw \
-		iwlwifi-5150-8.24.2.2.fw
-
-iwlwifi-4965-228.57.2.23.fw: ${FWDIR}/iwlwifi-4965-228.57.2.23.fw.uu
-	uudecode -p ${FWDIR}/iwlwifi-4965-228.57.2.23.fw.uu > ${.TARGET}
-
-iwlwifi-5000-5.4.A.11.fw: ${FWDIR}/iwlwifi-5000-5.4.A.11.fw.uu
-	uudecode -p ${FWDIR}/iwlwifi-5000-5.4.A.11.fw.uu > ${.TARGET}
-
-iwlwifi-5150-8.24.2.2.fw: ${FWDIR}/iwlwifi-5150-8.24.2.2.fw.uu
-	uudecode -p ${FWDIR}/iwlwifi-5150-8.24.2.2.fw.uu > ${.TARGET}
-
-.include 
+.include 

Added: head/sys/modules/iwnfw/Makefile.inc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/iwnfw/Makefile.inc	Sat Oct 24 09:55:11 2009	(r198439)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+#
+# Common rules for building firmware.  Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+
+_FIRM=	${IMG}.fw
+
+CLEANFILES+=	${_FIRM}
+
+FIRMWS=	${_FIRM}:${KMOD}
+
+${_FIRM}: ${.CURDIR}/../../../contrib/dev/iwn/${_FIRM}.uu
+	uudecode -p $? > ${.TARGET}

Added: head/sys/modules/iwnfw/iwn4965/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/iwnfw/iwn4965/Makefile	Sat Oct 24 09:55:11 2009	(r198439)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+KMOD=	iwn4965fw
+IMG=	iwlwifi-4965-228.57.2.23
+
+.include 

Added: head/sys/modules/iwnfw/iwn5000/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/iwnfw/iwn5000/Makefile	Sat Oct 24 09:55:11 2009	(r198439)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+KMOD=	iwn5000fw
+IMG=	iwlwifi-5000-5.4.A.11
+
+.include 

Added: head/sys/modules/iwnfw/iwn5150/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/iwnfw/iwn5150/Makefile	Sat Oct 24 09:55:11 2009	(r198439)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+KMOD=	iwn5150fw
+IMG=	iwlwifi-5150-8.24.2.2
+
+.include 

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 11:32:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D4BF1065670;
	Sat, 24 Oct 2009 11:32:03 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C74F8FC14;
	Sat, 24 Oct 2009 11:32:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OBW2w6089828;
	Sat, 24 Oct 2009 11:32:02 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OBW2Fa089825;
	Sat, 24 Oct 2009 11:32:02 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <200910241132.n9OBW2Fa089825@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 24 Oct 2009 11:32:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198441 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 11:32:03 -0000

Author: rpaulo
Date: Sat Oct 24 11:32:02 2009
New Revision: 198441
URL: http://svn.freebsd.org/changeset/base/198441

Log:
  Replace ocurrences of FreeBSD CURRENT by FreeBSD 8.0.
  
  MFC after:	2 days

Modified:
  head/share/man/man4/acpi_hp.4
  head/share/man/man4/acpi_wmi.4

Modified: head/share/man/man4/acpi_hp.4
==============================================================================
--- head/share/man/man4/acpi_hp.4	Sat Oct 24 11:02:26 2009	(r198440)
+++ head/share/man/man4/acpi_hp.4	Sat Oct 24 11:32:02 2009	(r198441)
@@ -256,7 +256,7 @@ sysctl dev.acpi_hp.0.cmi_detail=7
 The
 .Nm
 device driver first appeared in
-.Fx CURRENT .
+.Fx 8.0 .
 .Sh AUTHORS
 .An -nosplit
 The
@@ -279,7 +279,7 @@ http://www.microsoft.com/whdc/system/pnp
 This manual page was written by
 .An Michael Gmelin Aq freebsd@grem.de
 .Sh BUGS
-This driver is experimental and has only been tested on CURRENT i386 on an
+This driver is experimental and has only been tested on i386 on an
 HP Compaq 8510p which featured all supported wireless devices (WWAN/BT/WLAN).
 Expect undefined results when operating on different hardware.
 .Pp

Modified: head/share/man/man4/acpi_wmi.4
==============================================================================
--- head/share/man/man4/acpi_wmi.4	Sat Oct 24 11:02:26 2009	(r198440)
+++ head/share/man/man4/acpi_wmi.4	Sat Oct 24 11:32:02 2009	(r198441)
@@ -79,7 +79,7 @@ GUID                                  IN
 The
 .Nm
 device driver first appeared in
-.Fx CURRENT .
+.Fx 8.0 .
 .Sh AUTHORS
 .An -nosplit
 The

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 12:59:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 97B23106566B;
	Sat, 24 Oct 2009 12:59:29 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 868298FC12;
	Sat, 24 Oct 2009 12:59:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OCxTd8091486;
	Sat, 24 Oct 2009 12:59:29 GMT (envelope-from antoine@svn.freebsd.org)
Received: (from antoine@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OCxTIu091484;
	Sat, 24 Oct 2009 12:59:29 GMT (envelope-from antoine@svn.freebsd.org)
Message-Id: <200910241259.n9OCxTIu091484@svn.freebsd.org>
From: Antoine Brodin 
Date: Sat, 24 Oct 2009 12:59:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198443 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 12:59:29 -0000

Author: antoine
Date: Sat Oct 24 12:59:29 2009
New Revision: 198443
URL: http://svn.freebsd.org/changeset/base/198443

Log:
  Add more obsolete man pages.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Sat Oct 24 11:42:05 2009	(r198442)
+++ head/ObsoleteFiles.inc	Sat Oct 24 12:59:29 2009	(r198443)
@@ -14,6 +14,9 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20091005: fusword.9 and susword.9 removed
+OLD_FILES+=usr/share/man/man9/fusword.9.gz
+OLD_FILES+=usr/share/man/man9/susword.9.gz
 # 20090909: vesa and dpms promoted to be i386/amd64 common
 OLD_FILES+=usr/include/machine/pc/vesa.h
 OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz
@@ -26,6 +29,49 @@ OLD_FILES+=usr/share/man/man8/lukemftpd.
 OLD_FILES+=etc/mtree/BSD.local.dist
 OLD_FILES+=etc/mtree/BSD.x11.dist
 OLD_FILES+=etc/mtree/BSD.x11-4.dist
+# 20090812: net80211 documentation overhaul
+OLD_FILES+=usr/share/man/man9/ieee80211_add_rates.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_add_xrates.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_alloc_node.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_attach.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_begin_scan.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_cfgget.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_cfgset.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_chan2ieee.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_chan2mode.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_create_ibss.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_crypto_attach.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_crypto_detach.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_decap.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_dump_pkt.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_dup_bss.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_encap.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_end_scan.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_find_node.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_fix_rate.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_free_allnodes.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_ieee2mhz.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_ioctl.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_lookup_node.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_media2rate.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_media_change.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_media_init.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_media_status.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_mhz2ieee.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_next_scan.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_node_attach.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_node_detach.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_node_lateattach.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_print_essid.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_proto_attach.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_proto_detach.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_rate2media.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_recv_mgmt.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_send_mgmt.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_setmode.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_timeout_nodes.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_watchdog.9.gz
+OLD_FILES+=usr/share/man/man9/ieee80211_wep_crypt.9.gz
 # 20090801: vimage.h removed in favour of vnet.h
 OLD_FILES+=usr/include/sys/vimage.h
 # 20090719: library version bump for 8.0

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 16:26:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D6C31065692;
	Sat, 24 Oct 2009 16:26:07 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211])
	by mx1.freebsd.org (Postfix) with ESMTP id 3A3168FC1D;
	Sat, 24 Oct 2009 16:26:07 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset=UTF-8; format=flowed
Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by
	smtpauth2.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7.0-5.01 32bit (built Feb 19
	2009)) id <0KS1006001NI7500@smtpauth2.wiscmail.wisc.edu>; Sat,
	24 Oct 2009 11:26:06 -0500 (CDT)
Received: from comporellon.tachypleus.net
	(adsl-76-208-71-118.dsl.mdsnwi.sbcglobal.net [76.208.71.118])
	by smtpauth2.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7.0-5.01 32bit (built Feb 19
	2009))
	with ESMTPSA id <0KS100K6U1NGLB30@smtpauth2.wiscmail.wisc.edu>; Sat,
	24 Oct 2009 11:26:05 -0500 (CDT)
Date: Sat, 24 Oct 2009 11:26:04 -0500
From: Nathan Whitehorn 
In-reply-to: <200910240955.n9O9tCXP087115@svn.freebsd.org>
To: Rui Paulo 
Message-id: <4AE32A9C.10400@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.71.118
X-Spam-PmxInfo: Server=avs-13, Version=5.5.5.374460,
	Antispam-Engine: 2.7.1.369594, Antispam-Data: 2009.10.24.161228,
	SenderIP=76.208.71.118
References: <200910240955.n9O9tCXP087115@svn.freebsd.org>
User-Agent: Thunderbird 2.0.0.23 (X11/20090905)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198439 - in head/sys: dev/iwn modules/iwnfw
 modules/iwnfw/iwn4965 modules/iwnfw/iwn5000 modules/iwnfw/iwn5150
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 16:26:07 -0000

Rui Paulo wrote:
> Author: rpaulo
> Date: Sat Oct 24 09:55:11 2009
> New Revision: 198439
> URL: http://svn.freebsd.org/changeset/base/198439
>
> Log:
>   Updates to the iwn driver:
>   * iwnfw has now been split into individual modules so autoloading of
>     firmware module(s) does work again.
>   * Changes have been made to RUN -> AUTH transition, this should fix the
>     issue reported by Glen and others.
>   * Brandon reported issues in iwn_cmd() with large commands, those have
>     been fixed to.
>   * DEAUTH is now handled correctly.
>   
>   Submitted by:	Bernhard Schmidt 
>   
I think you missed some changes to /sys/conf/files, if you want to build 
iwnfw into the kernel. /sys/conf/files still references the old 4965 
firmware (breaking the build for kernels including device iwnfw), and 
doesn't include the 5000-series firmware at all. Thanks to you and 
Bernhard for the update!
-Nathan

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 18:31:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBAF010656AA;
	Sat, 24 Oct 2009 18:31:22 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AABC38FC28;
	Sat, 24 Oct 2009 18:31:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OIVMWR004251;
	Sat, 24 Oct 2009 18:31:22 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OIVMg2004249;
	Sat, 24 Oct 2009 18:31:22 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910241831.n9OIVMg2004249@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 24 Oct 2009 18:31:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198444 - head/sys/powerpc/powermac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 18:31:22 -0000

Author: nwhitehorn
Date: Sat Oct 24 18:31:22 2009
New Revision: 198444
URL: http://svn.freebsd.org/changeset/base/198444

Log:
  Allow Heathrow-based machines to boot a kernel containing option SMP
  without panicing.

Modified:
  head/sys/powerpc/powermac/hrowpic.c

Modified: head/sys/powerpc/powermac/hrowpic.c
==============================================================================
--- head/sys/powerpc/powermac/hrowpic.c	Sat Oct 24 12:59:29 2009	(r198443)
+++ head/sys/powerpc/powermac/hrowpic.c	Sat Oct 24 18:31:22 2009	(r198444)
@@ -182,7 +182,13 @@ hrowpic_toggle_irq(struct hrowpic_softc 
 	u_int roffset;
 	u_int rbit;
 
-	KASSERT((irq > 0) && (irq < HROWPIC_IRQMAX), ("en irq out of range"));
+	KASSERT((irq > 0) && (irq <= HROWPIC_IRQMAX), ("en irq out of range"));
+
+	/*
+	 * Humor the SMP layer if it wants to set up an IPI handler.
+	 */
+	if (irq == HROWPIC_IRQMAX)
+		return;
 
 	/*
 	 * Calculate prim/sec register bank for the IRQ, update soft copy,

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 18:33:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 26FA4106566B;
	Sat, 24 Oct 2009 18:33:02 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 151578FC1B;
	Sat, 24 Oct 2009 18:33:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OIX1fP004436;
	Sat, 24 Oct 2009 18:33:01 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OIX1RD004433;
	Sat, 24 Oct 2009 18:33:01 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200910241833.n9OIX1RD004433@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 24 Oct 2009 18:33:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198445 - in head/sys/powerpc: include powerpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 18:33:02 -0000

Author: nwhitehorn
Date: Sat Oct 24 18:33:01 2009
New Revision: 198445
URL: http://svn.freebsd.org/changeset/base/198445

Log:
  Turn on NAP mode on G5 systems, and refactor the HID0 setup code a little.
  This makes my G5 Xserve sound slightly less like it is filled with
  howling banshees.

Modified:
  head/sys/powerpc/include/hid.h
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/include/hid.h
==============================================================================
--- head/sys/powerpc/include/hid.h	Sat Oct 24 18:31:22 2009	(r198444)
+++ head/sys/powerpc/include/hid.h	Sat Oct 24 18:33:01 2009	(r198445)
@@ -41,6 +41,7 @@
 #define HID0_ECLK	0x02000000  /* CLK_OUT clock type selection */
 #define HID0_PAR	0x01000000  /* Disable precharge of ARTRY */
 #define HID0_STEN	0x01000000  /* Software table search enable (7450) */
+#define HID0_DEEPNAP	0x01000000  /* Enable deep nap mode (970) */
 #define HID0_HBATEN	0x00800000  /* High BAT enable (74[45][578])  */
 #define HID0_DOZE	0x00800000  /* Enable doze mode */
 #define HID0_NAP	0x00400000  /* Enable nap mode */
@@ -98,6 +99,12 @@
     "\020b16\017TBEN\016SEL_TBCLK\015b19\014b20\013b21\012b22\011b23"	\
     "\010EN_MAS7_UPDATE\007DCFA\006b26\005b27\004b28\003b29\002b30\001NOPTI"
 
+#define HID0_970_BITMASK						\
+    "\20"								\
+    "\040ONEPPC\037SINGLE\036ISYNCSC\035SERGP\031DEEPNAP\030DOZE"	\
+    "\027NAP\025DPM\023TG\022HANGDETECT\021NHR\020INORDER"		\
+    "\016TBCTRL\015TBEN\012CIABREN\011HDICEEN\001ENATTN"		
+
 /*
  *  HID0 bit definitions per cpu model
  *

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c	Sat Oct 24 18:31:22 2009	(r198444)
+++ head/sys/powerpc/powerpc/cpu.c	Sat Oct 24 18:33:01 2009	(r198445)
@@ -114,16 +114,19 @@ static char model[64];
 SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, "");
 
 static void	cpu_print_speed(void);
-static void	cpu_print_cacheinfo(u_int, uint16_t);
+
+static void	cpu_6xx_setup(int cpuid, uint16_t vers);
+static void	cpu_6xx_print_cacheinfo(u_int, uint16_t);
+static void	cpu_e500_setup(int cpuid, uint16_t vers);
+static void	cpu_970_setup(int cpuid, uint16_t vers);
 
 void
 cpu_setup(u_int cpuid)
 {
-	u_int		pvr, maj, min, hid0;
+	u_int		pvr, maj, min;
 	uint16_t	vers, rev, revfmt;
 	const struct	cputab *cp;
 	const char	*name;
-	char		*bitmask;
 
 	pvr = mfpvr();
 	vers = pvr >> 16;
@@ -170,10 +173,8 @@ cpu_setup(u_int cpuid)
 			break;
 	}
 
-	hid0 = mfspr(SPR_HID0);
-
 	/*
-	 * Configure power-saving mode.
+	 * Configure CPU
 	 */
 	switch (vers) {
 		case MPC603:
@@ -184,102 +185,34 @@ cpu_setup(u_int cpuid)
 		case IBM750FX:
 		case MPC7400:
 		case MPC7410:
-		case MPC8240:
-		case MPC8245:
-			/* Select DOZE mode. */
-			hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
-			hid0 |= HID0_DOZE | HID0_DPM;
-			powerpc_pow_enabled = 1;
-			break;
-
-		case MPC7448:
-		case MPC7447A:
-		case MPC7457:
-		case MPC7455:
-		case MPC7450:
-			/* Enable the 7450 branch caches */
-			hid0 |= HID0_SGE | HID0_BTIC;
-			hid0 |= HID0_LRSTK | HID0_FOLD | HID0_BHT;
-			/* Disable BTIC on 7450 Rev 2.0 or earlier and on 7457 */
-			if (((pvr >> 16) == MPC7450 && (pvr & 0xFFFF) <= 0x0200)
-					|| (pvr >> 16) == MPC7457)
-				hid0 &= ~HID0_BTIC;
-			/* Select NAP mode. */
-			hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
-			hid0 |= HID0_NAP | HID0_DPM;
-			powerpc_pow_enabled = 1;
-			break;
-
-		default:
-			/* No power-saving mode is available. */ ;
-	}
-
-	switch (vers) {
-		case IBM750FX:
-		case MPC750:
-			hid0 &= ~HID0_DBP;		/* XXX correct? */
-			hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT;
-			break;
-
-		case MPC7400:
-		case MPC7410:
-			hid0 &= ~HID0_SPD;
-			hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT;
-			hid0 |= HID0_EIEC;
-			break;
-
-		case FSL_E500v1:
-		case FSL_E500v2:
-			break;
-	}
-
-	mtspr(SPR_HID0, hid0);
-
-	switch (vers) {
 		case MPC7447A:
 		case MPC7448:
 		case MPC7450:
 		case MPC7455:
 		case MPC7457:
-			bitmask = HID0_7450_BITMASK;
-			break;
-		case FSL_E500v1:
-		case FSL_E500v2:
-			bitmask = HID0_E500_BITMASK;
-			break;
-		default:
-			bitmask = HID0_BITMASK;
+		case MPC8240:
+		case MPC8245:
+			cpu_6xx_setup(cpuid, vers);
 			break;
-	}
 
-	switch (vers) {
-		case MPC7450:
-		case MPC7455:
-		case MPC7457:
-		case MPC750:
-		case IBM750FX:
-		case MPC7400:
-		case MPC7410:
-		case MPC7447A:
-		case MPC7448:
-			cpu_print_speed();
-			printf("\n");
-
-			if (bootverbose)
-				cpu_print_cacheinfo(cpuid, vers);
-			break;
 		case IBM970:
 		case IBM970FX:
+		case IBM970GX:
 		case IBM970MP:
-			cpu_print_speed();
-			printf("\n");
+			cpu_970_setup(cpuid, vers);
+			break;
+
+		case FSL_E500v1:
+		case FSL_E500v2:
+			cpu_e500_setup(cpuid, vers);
 			break;
+
 		default:
-			printf("\n");
+			/* HID setup is unknown */
 			break;
 	}
 
-	printf("cpu%d: HID0 %b\n", cpuid, hid0, bitmask);
+	printf("\n");
 }
 
 void
@@ -346,10 +279,101 @@ cpu_est_clockrate(int cpu_id, uint64_t *
 }
 
 void
-cpu_print_cacheinfo(u_int cpuid, uint16_t vers)
+cpu_6xx_setup(int cpuid, uint16_t vers)
 {
-	uint32_t hid;
+	register_t hid0, pvr;
+	const char *bitmask;
 
+	hid0 = mfspr(SPR_HID0);
+	pvr = mfpvr();
+
+	/*
+	 * Configure power-saving mode.
+	 */
+	switch (vers) {
+		case MPC603:
+		case MPC603e:
+		case MPC603ev:
+		case MPC604ev:
+		case MPC750:
+		case IBM750FX:
+		case MPC7400:
+		case MPC7410:
+		case MPC8240:
+		case MPC8245:
+			/* Select DOZE mode. */
+			hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
+			hid0 |= HID0_DOZE | HID0_DPM;
+			powerpc_pow_enabled = 1;
+			break;
+
+		case MPC7448:
+		case MPC7447A:
+		case MPC7457:
+		case MPC7455:
+		case MPC7450:
+			/* Enable the 7450 branch caches */
+			hid0 |= HID0_SGE | HID0_BTIC;
+			hid0 |= HID0_LRSTK | HID0_FOLD | HID0_BHT;
+			/* Disable BTIC on 7450 Rev 2.0 or earlier and on 7457 */
+			if (((pvr >> 16) == MPC7450 && (pvr & 0xFFFF) <= 0x0200)
+					|| (pvr >> 16) == MPC7457)
+				hid0 &= ~HID0_BTIC;
+			/* Select NAP mode. */
+			hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
+			hid0 |= HID0_NAP | HID0_DPM;
+			powerpc_pow_enabled = 1;
+			break;
+
+		default:
+			/* No power-saving mode is available. */ ;
+	}
+
+	switch (vers) {
+		case IBM750FX:
+		case MPC750:
+			hid0 &= ~HID0_DBP;		/* XXX correct? */
+			hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT;
+			break;
+
+		case MPC7400:
+		case MPC7410:
+			hid0 &= ~HID0_SPD;
+			hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT;
+			hid0 |= HID0_EIEC;
+			break;
+
+	}
+
+	mtspr(SPR_HID0, hid0);
+
+	cpu_print_speed();
+	printf("\n");
+
+	if (bootverbose)
+		cpu_6xx_print_cacheinfo(cpuid, vers);
+
+	switch (vers) {
+		case MPC7447A:
+		case MPC7448:
+		case MPC7450:
+		case MPC7455:
+		case MPC7457:
+			bitmask = HID0_7450_BITMASK;
+			break;
+		default:
+			bitmask = HID0_BITMASK;
+			break;
+	}
+
+	printf("cpu%d: HID0 %b", cpuid, (int)hid0, bitmask);
+}
+
+
+static void
+cpu_6xx_print_cacheinfo(u_int cpuid, uint16_t vers)
+{
+	register_t hid;
 
 	hid = mfspr(SPR_HID0);
 	printf("cpu%u: ", cpuid);
@@ -395,3 +419,43 @@ cpu_print_cacheinfo(u_int cpuid, uint16_
 	} else
 		printf("L2 cache disabled\n");
 }
+
+static void
+cpu_e500_setup(int cpuid, uint16_t vers)
+{
+	register_t hid0;
+
+	hid0 = mfspr(SPR_HID0);
+	printf("cpu%d: HID0 %b", cpuid, (int)hid0, HID0_E500_BITMASK);
+}
+
+static void
+cpu_970_setup(int cpuid, uint16_t vers)
+{
+	uint32_t hid0_hi, hid0_lo;
+
+	__asm __volatile ("mfspr %0,%2; clrldi %1,%0,32; srdi %0,%0,32;"
+	    : "=r" (hid0_hi), "=r" (hid0_lo) : "K" (SPR_HID0));
+
+	/* Configure power-saving mode */
+	hid0_hi |= (HID0_NAP | HID0_DPM);
+	hid0_hi &= ~(HID0_DOZE | HID0_DEEPNAP);
+	powerpc_pow_enabled = 1;
+
+	__asm __volatile (" \
+		sync; isync;					\
+		sldi	%0,%0,32; or %0,%0,%1;			\
+		mtspr	%2, %0;					\
+		mfspr   %0, %2; mfspr   %0, %2; mfspr   %0, %2; \
+		mfspr   %0, %2; mfspr   %0, %2; mfspr   %0, %2; \
+		sync; isync"
+	    :: "r" (hid0_hi), "r"(hid0_lo), "K" (SPR_HID0));
+
+	cpu_print_speed();
+	printf("\n");
+
+	__asm __volatile ("mfspr %0,%1; srdi %0,%0,32;"
+	    : "=r" (hid0_hi) : "K" (SPR_HID0));
+	printf("cpu%d: HID0 %b", cpuid, (int)(hid0_hi), HID0_970_BITMASK);
+}
+

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 18:49:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84A7A1065693;
	Sat, 24 Oct 2009 18:49:18 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 73ED58FC29;
	Sat, 24 Oct 2009 18:49:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OInIxZ005412;
	Sat, 24 Oct 2009 18:49:18 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OInIvI005409;
	Sat, 24 Oct 2009 18:49:18 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200910241849.n9OInIvI005409@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Sat, 24 Oct 2009 18:49:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198448 - in head/sys: fs/smbfs netgraph
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 18:49:18 -0000

Author: ru
Date: Sat Oct 24 18:49:17 2009
New Revision: 198448
URL: http://svn.freebsd.org/changeset/base/198448

Log:
  Spell DIAGNOSTIC correctly.

Modified:
  head/sys/fs/smbfs/smbfs_vfsops.c
  head/sys/netgraph/NOTES

Modified: head/sys/fs/smbfs/smbfs_vfsops.c
==============================================================================
--- head/sys/fs/smbfs/smbfs_vfsops.c	Sat Oct 24 18:38:24 2009	(r198447)
+++ head/sys/fs/smbfs/smbfs_vfsops.c	Sat Oct 24 18:49:17 2009	(r198448)
@@ -259,7 +259,7 @@ smbfs_mount(struct mount *mp)
 	VOP_UNLOCK(vp, 0);
 	SMBVDEBUG("root.v_usecount = %d\n", vrefcnt(vp));
 
-#ifdef DIAGNOSTICS
+#ifdef DIAGNOSTIC
 	SMBERROR("mp=%p\n", mp);
 #endif
 	return error;

Modified: head/sys/netgraph/NOTES
==============================================================================
--- head/sys/netgraph/NOTES	Sat Oct 24 18:38:24 2009	(r198447)
+++ head/sys/netgraph/NOTES	Sat Oct 24 18:49:17 2009	(r198448)
@@ -76,10 +76,10 @@ Archie's suggestions... :-)
      be careful with things like #ifdef INET.
    - All nodes assume that all data mbufs have the M_PKTHDR flag set!
      The ng_send_data() and related functions should have an
-     #ifdef DIAGNOSTICS check to check this assumption for every mbuf.
+     #ifdef DIAGNOSTIC check to check this assumption for every mbuf.
      -DONE with INVARIANTS. Framework should test this more.
    - More generally, netgraph code should make liberal use of the
-     #ifdef DIAGNOSTICS definition.
+     #ifdef DIAGNOSTIC definition.
      -INVARIANTS.
    - Since data and messages are sent functionally, programmers need
      to watch out for infinite feedback loops. Should ng_base.c detect

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 19:00:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B90D9106566B;
	Sat, 24 Oct 2009 19:00:58 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A89A78FC14;
	Sat, 24 Oct 2009 19:00:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OJ0wb0005891;
	Sat, 24 Oct 2009 19:00:58 GMT (envelope-from ru@svn.freebsd.org)
Received: (from ru@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OJ0wQl005889;
	Sat, 24 Oct 2009 19:00:58 GMT (envelope-from ru@svn.freebsd.org)
Message-Id: <200910241900.n9OJ0wQl005889@svn.freebsd.org>
From: Ruslan Ermilov 
Date: Sat, 24 Oct 2009 19:00:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198449 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 19:00:58 -0000

Author: ru
Date: Sat Oct 24 19:00:58 2009
New Revision: 198449
URL: http://svn.freebsd.org/changeset/base/198449

Log:
  - Rename tunable kern.ipc.shmmaxpgs to kern.ipc.shmall.
  - Explain the fuss when initializing shmmax.
  
  PR:	75542 (mistakenly closed instead of PR 75541)

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c	Sat Oct 24 18:49:17 2009	(r198448)
+++ head/sys/kern/sysv_shm.c	Sat Oct 24 19:00:58 2009	(r198449)
@@ -821,12 +821,19 @@ shminit()
 {
 	int i;
 
-	TUNABLE_ULONG_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall);
+#ifndef BURN_BRIDGES
+	if (TUNABLE_ULONG_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall) != 0)
+		printf("kern.ipc.shmmaxpgs is now called kern.ipc.shmall!\n");
+#endif
+	TUNABLE_ULONG_FETCH("kern.ipc.shmall", &shminfo.shmall);
+
+	/* Initialize shmmax dealing with possible overflow. */
 	for (i = PAGE_SIZE; i > 0; i--) {
 		shminfo.shmmax = shminfo.shmall * i;
 		if (shminfo.shmmax >= shminfo.shmall)
 			break;
 	}
+
 	TUNABLE_ULONG_FETCH("kern.ipc.shmmin", &shminfo.shmmin);
 	TUNABLE_ULONG_FETCH("kern.ipc.shmmni", &shminfo.shmmni);
 	TUNABLE_ULONG_FETCH("kern.ipc.shmseg", &shminfo.shmseg);

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 20:07:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1D7DB1065676;
	Sat, 24 Oct 2009 20:07:18 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 02BAD8FC0A;
	Sat, 24 Oct 2009 20:07:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OK7HlA009086;
	Sat, 24 Oct 2009 20:07:17 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OK7Htr009082;
	Sat, 24 Oct 2009 20:07:17 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910242007.n9OK7Htr009082@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 24 Oct 2009 20:07:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198450 - in head/lib/libthr/arch/ia64: . ia64 include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 20:07:18 -0000

Author: marcel
Date: Sat Oct 24 20:07:17 2009
New Revision: 198450
URL: http://svn.freebsd.org/changeset/base/198450

Log:
  Implement _umtx_op_err() for ia64.

Added:
  head/lib/libthr/arch/ia64/ia64/_umtx_op_err.S   (contents, props changed)
Modified:
  head/lib/libthr/arch/ia64/Makefile.inc
  head/lib/libthr/arch/ia64/include/pthread_md.h

Modified: head/lib/libthr/arch/ia64/Makefile.inc
==============================================================================
--- head/lib/libthr/arch/ia64/Makefile.inc	Sat Oct 24 19:00:58 2009	(r198449)
+++ head/lib/libthr/arch/ia64/Makefile.inc	Sat Oct 24 20:07:17 2009	(r198450)
@@ -2,4 +2,4 @@
 
 .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
 
-SRCS+= pthread_md.c
+SRCS+= _umtx_op_err.S pthread_md.c

Added: head/lib/libthr/arch/ia64/ia64/_umtx_op_err.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libthr/arch/ia64/ia64/_umtx_op_err.S	Sat Oct 24 20:07:17 2009	(r198450)
@@ -0,0 +1,35 @@
+/*-
+ * Copyright (c) 2009 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+
+ENTRY(_umtx_op_err, 5)
+	CALLSYS_NOERROR(_umtx_op)
+	br.ret.sptk.few rp
+END(_umtx_op_err)

Modified: head/lib/libthr/arch/ia64/include/pthread_md.h
==============================================================================
--- head/lib/libthr/arch/ia64/include/pthread_md.h	Sat Oct 24 19:00:58 2009	(r198449)
+++ head/lib/libthr/arch/ia64/include/pthread_md.h	Sat Oct 24 20:07:17 2009	(r198450)
@@ -33,6 +33,8 @@
 
 #define	CPU_SPINWAIT
 
+#define	HAS__UMTX_OP_ERR	1
+
 #define	DTV_OFFSET		offsetof(struct tcb, tcb_dtv)
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 20:28:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B00F3106568B;
	Sat, 24 Oct 2009 20:28:42 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F5A58FC0C;
	Sat, 24 Oct 2009 20:28:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OKSgIr010199;
	Sat, 24 Oct 2009 20:28:42 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OKSg2u010197;
	Sat, 24 Oct 2009 20:28:42 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910242028.n9OKSg2u010197@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 24 Oct 2009 20:28:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198451 - head/sys/ia64/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 20:28:42 -0000

Author: marcel
Date: Sat Oct 24 20:28:42 2009
New Revision: 198451
URL: http://svn.freebsd.org/changeset/base/198451

Log:
  A 32KB kernel stack is not quite enough. The new USB stack is a bit
  more stack hungry as compared to the old one that my RX2660 gets
  a machine check and spontaneously reboots at the time the USB DVD
  drive is found and attached to CAM as a mass storage device. This
  doesn't happen always, but definitely varies per kernel build.
  Likewise when using a 128-byte printf buffer. The additional 128
  bytes that printf needs seems to be enough to have the memory stack
  and register stack collide and causing a machine check.
  
  Thus: Bump KSTACK_PAGES from 4 to 5.

Modified:
  head/sys/ia64/include/param.h

Modified: head/sys/ia64/include/param.h
==============================================================================
--- head/sys/ia64/include/param.h	Sat Oct 24 20:07:17 2009	(r198450)
+++ head/sys/ia64/include/param.h	Sat Oct 24 20:28:42 2009	(r198451)
@@ -92,7 +92,7 @@
 #define	MAXPAGESIZES	1		/* maximum number of supported page sizes */
 
 #ifndef	KSTACK_PAGES
-#define	KSTACK_PAGES	4		/* pages of kernel stack */
+#define	KSTACK_PAGES	5		/* pages of kernel stack */
 #endif
 #define	KSTACK_GUARD_PAGES 0		/* pages of kstack guard; 0 disables */
 

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 20:35:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4947F1065676;
	Sat, 24 Oct 2009 20:35:35 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 389908FC22;
	Sat, 24 Oct 2009 20:35:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OKZZSA010553;
	Sat, 24 Oct 2009 20:35:35 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OKZZ7k010551;
	Sat, 24 Oct 2009 20:35:35 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200910242035.n9OKZZ7k010551@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 24 Oct 2009 20:35:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198452 - head/sys/ia64/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 20:35:35 -0000

Author: marcel
Date: Sat Oct 24 20:35:34 2009
New Revision: 198452
URL: http://svn.freebsd.org/changeset/base/198452

Log:
  Add PRINTF_BUFR_SIZE=128, since we have SMP by default.
  While here, fix tabulation.

Modified:
  head/sys/ia64/conf/GENERIC

Modified: head/sys/ia64/conf/GENERIC
==============================================================================
--- head/sys/ia64/conf/GENERIC	Sat Oct 24 20:28:42 2009	(r198451)
+++ head/sys/ia64/conf/GENERIC	Sat Oct 24 20:35:34 2009	(r198452)
@@ -40,13 +40,14 @@ options 	INVARIANTS	# Enable calls of ex
 options 	INVARIANT_SUPPORT # required by INVARIANTS
 options 	KDB		# Enable kernel debugger support
 options 	KTRACE		# ktrace(1) syscall trace support
-options 	MAC			# TrustedBSD MAC Framework
+options 	MAC		# TrustedBSD MAC Framework
 options 	MD_ROOT		# MD usable as root device
 options 	MSDOSFS		# MSDOS Filesystem
 options 	NFSCLIENT	# Network Filesystem Client
 options 	NFSSERVER	# Network Filesystem Server
 options 	NFSLOCKD	# Network Lock Manager
 options 	NFS_ROOT	# NFS usable as root device
+options 	PRINTF_BUFR_SIZE=128  # Printf buffering to limit interspersion
 options 	PROCFS		# Process filesystem (/proc)
 options 	PSEUDOFS	# Pseudo-filesystem framework
 options 	SCHED_ULE	# ULE scheduler
@@ -65,7 +66,7 @@ options 	UFS_GJOURNAL	# Enable gjournal-
 options 	WITNESS		# Enable checks to detect deadlocks and cycles
 options 	WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
 options 	_KPOSIX_PRIORITY_SCHEDULING	# Posix P1003_1B RT extensions
-options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
+options 	HWPMC_HOOKS	# Necessary kernel hooks for hwpmc(4)
 
 # Various "busses"
 device		firewire	# FireWire bus code

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 20:57:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E0281065694;
	Sat, 24 Oct 2009 20:57:12 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 639B18FC16;
	Sat, 24 Oct 2009 20:57:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OKvCD3011668;
	Sat, 24 Oct 2009 20:57:12 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OKvC2v011665;
	Sat, 24 Oct 2009 20:57:12 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200910242057.n9OKvC2v011665@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 24 Oct 2009 20:57:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198453 - head/tools/regression/bin/sh/expansion
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 20:57:12 -0000

Author: jilles
Date: Sat Oct 24 20:57:11 2009
New Revision: 198453
URL: http://svn.freebsd.org/changeset/base/198453

Log:
  Add some tests for ${var?} and set -u.

Added:
  head/tools/regression/bin/sh/expansion/question1.0   (contents, props changed)
  head/tools/regression/bin/sh/expansion/set-u1.0   (contents, props changed)

Added: head/tools/regression/bin/sh/expansion/question1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/question1.0	Sat Oct 24 20:57:11 2009	(r198453)
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+x=a\ b
+[ "$x" = "${x?}" ] || exit 1
+set -- ${x?}
+{ [ "$#" = 2 ] && [ "$1" = a ] && [ "$2" = b ]; } || exit 1
+unset x
+(echo ${x?abcdefg}) 2>&1 | grep -q abcdefg || exit 1
+sh -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 1
+sh -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 1
+sh -c 'foo=; echo ${foo?}' >/dev/null || exit 1
+sh -c 'foo=1; echo ${foo:?}' >/dev/null || exit 1
+sh -c 'echo ${!?}' 2>/dev/null && exit 1
+sh -c ':& echo ${!?}' >/dev/null || exit 1
+sh -c 'echo ${#?}' >/dev/null || exit 1
+sh -c 'echo ${*?}' 2>/dev/null && exit 1
+sh -c 'echo ${*?}' sh x >/dev/null || exit 1
+sh -c 'echo ${1?}' 2>/dev/null && exit 1
+sh -c 'echo ${1?}' sh x >/dev/null || exit 1
+sh -c 'echo ${2?}' sh x 2>/dev/null && exit 1
+sh -c 'echo ${2?}' sh x y >/dev/null || exit 1
+exit 0

Added: head/tools/regression/bin/sh/expansion/set-u1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/set-u1.0	Sat Oct 24 20:57:11 2009	(r198453)
@@ -0,0 +1,29 @@
+# $FreeBSD$
+
+sh -uc 'unset foo; echo $foo' 2>/dev/null && exit 1
+sh -uc 'foo=; echo $foo' >/dev/null || exit 1
+sh -uc 'foo=1; echo $foo' >/dev/null || exit 1
+# -/+/= are unaffected by set -u
+sh -uc 'unset foo; echo ${foo-}' >/dev/null || exit 1
+sh -uc 'unset foo; echo ${foo+}' >/dev/null || exit 1
+sh -uc 'unset foo; echo ${foo=}' >/dev/null || exit 1
+# length/trimming are affected
+sh -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 1
+sh -uc 'foo=; echo ${#foo}' >/dev/null || exit 1
+sh -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 1
+sh -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 1
+sh -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 1
+sh -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 1
+sh -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 1
+sh -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 1
+sh -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 1
+sh -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 1
+
+sh -uc 'echo $!' 2>/dev/null && exit 1
+sh -uc ':& echo $!' >/dev/null || exit 1
+sh -uc 'echo $#' >/dev/null || exit 1
+sh -uc 'echo $1' 2>/dev/null && exit 1
+sh -uc 'echo $1' sh x >/dev/null || exit 1
+sh -uc 'echo $2' sh x 2>/dev/null && exit 1
+sh -uc 'echo $2' sh x y >/dev/null || exit 1
+exit 0

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 21:20:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EDC761065670;
	Sat, 24 Oct 2009 21:20:04 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C2ED78FC20;
	Sat, 24 Oct 2009 21:20:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9OLK4Ys012819;
	Sat, 24 Oct 2009 21:20:04 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9OLK4ZM012814;
	Sat, 24 Oct 2009 21:20:04 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200910242120.n9OLK4ZM012814@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 24 Oct 2009 21:20:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r198454 - in head: bin/sh
	tools/regression/bin/sh/expansion
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 21:20:05 -0000

Author: jilles
Date: Sat Oct 24 21:20:04 2009
New Revision: 198454
URL: http://svn.freebsd.org/changeset/base/198454

Log:
  sh: Exempt $@ and $* from set -u
  
  This seems more useful and will likely be in the next POSIX standard.
  
  Also document more precisely in the man page what set -u does (note that
  $@, $* and $! are the only special parameters that can ever be unset, all
  the others are always set, although they may be empty).

Added:
  head/tools/regression/bin/sh/expansion/set-u2.0   (contents, props changed)
Modified:
  head/bin/sh/expand.c
  head/bin/sh/sh.1

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Sat Oct 24 20:57:11 2009	(r198453)
+++ head/bin/sh/expand.c	Sat Oct 24 21:20:04 2009	(r198454)
@@ -657,7 +657,7 @@ again: /* jump here after setting a vari
 	}
 	varlen = 0;
 	startloc = expdest - stackblock();
-	if (!set && uflag) {
+	if (!set && uflag && *var != '@' && *var != '*') {
 		switch (subtype) {
 		case VSNORMAL:
 		case VSTRIMLEFT:

Modified: head/bin/sh/sh.1
==============================================================================
--- head/bin/sh/sh.1	Sat Oct 24 20:57:11 2009	(r198453)
+++ head/bin/sh/sh.1	Sat Oct 24 21:20:04 2009	(r198454)
@@ -32,7 +32,7 @@
 .\"	from: @(#)sh.1	8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd May 31, 2009
+.Dd October 24, 2009
 .Dt SH 1
 .Os
 .Sh NAME
@@ -296,7 +296,10 @@ sh -T -c "trap 'exit 1' 2 ; some-blockin
 .Ed
 .It Fl u Li nounset
 Write a message to standard error when attempting
-to expand a variable that is not set, and if the
+to expand a variable, a positional parameter or
+the special parameter
+.Va \&!
+that is not set, and if the
 shell is not interactive, exit immediately.
 .It Fl V Li vi
 Enable the built-in

Added: head/tools/regression/bin/sh/expansion/set-u2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/set-u2.0	Sat Oct 24 21:20:04 2009	(r198454)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+set -u
+: $* $@ "$@" "$*"
+set -- x
+: $* $@ "$@" "$*"
+shift $#
+: $* $@ "$@" "$*"
+set -- y
+set --
+: $* $@ "$@" "$*"
+exit 0

From owner-svn-src-head@FreeBSD.ORG  Sat Oct 24 23:14:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 738FD106566C;
	Sat, 24 Oct 2009 23:14:18 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 4DA638FC15;
	Sat, 24 Oct 2009 23:14:18 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id DAA2046B03;
	Sat, 24 Oct 2009 19:14:17 -0400 (EDT)
Date: Sun, 25 Oct 2009 00:14:17 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Marcel Moolenaar 
In-Reply-To: <200910242028.n9OKSg2u010197@svn.freebsd.org>
Message-ID: 
References: <200910242028.n9OKSg2u010197@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r198451 - head/sys/ia64/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 24 Oct 2009 23:14:18 -0000


On Sat, 24 Oct 2009, Marcel Moolenaar wrote:

> Log:
>  A 32KB kernel stack is not quite enough. The new USB stack is a bit
>  more stack hungry as compared to the old one that my RX2660 gets
>  a machine check and spontaneously reboots at the time the USB DVD
>  drive is found and attached to CAM as a mass storage device. This
>  doesn't happen always, but definitely varies per kernel build.
>  Likewise when using a 128-byte printf buffer. The additional 128
>  bytes that printf needs seems to be enough to have the memory stack
>  and register stack collide and causing a machine check.

I recently noticed, somewhat to my surprise, that BPF drops a 512-byte buffer 
on the stack while running filters...

Robert

>
>  Thus: Bump KSTACK_PAGES from 4 to 5.
>
> Modified:
>  head/sys/ia64/include/param.h
>
> Modified: head/sys/ia64/include/param.h
> ==============================================================================
> --- head/sys/ia64/include/param.h	Sat Oct 24 20:07:17 2009	(r198450)
> +++ head/sys/ia64/include/param.h	Sat Oct 24 20:28:42 2009	(r198451)
> @@ -92,7 +92,7 @@
> #define	MAXPAGESIZES	1		/* maximum number of supported page sizes */
>
> #ifndef	KSTACK_PAGES
> -#define	KSTACK_PAGES	4		/* pages of kernel stack */
> +#define	KSTACK_PAGES	5		/* pages of kernel stack */
> #endif
> #define	KSTACK_GUARD_PAGES 0		/* pages of kstack guard; 0 disables */
>
>