diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/drm/drmP.h | 14 | ||||
-rw-r--r-- | sys/dev/drm/drm_agpsupport.c | 2 | ||||
-rw-r--r-- | sys/dev/drm/drm_drv.c | 2 | ||||
-rw-r--r-- | sys/dev/drm/drm_memory.c | 2 | ||||
-rw-r--r-- | sys/dev/drm/drm_sysctl.c | 2 | ||||
-rw-r--r-- | sys/dev/drm/radeon_cs.c | 2 | ||||
-rw-r--r-- | sys/dev/firewire/00README | 4 | ||||
-rw-r--r-- | sys/dev/mii/brgphy.c | 22 | ||||
-rw-r--r-- | sys/dev/mii/mii.c | 3 | ||||
-rw-r--r-- | sys/dev/mpt/mpt.h | 8 | ||||
-rw-r--r-- | sys/dev/nfe/if_nfe.c | 50 | ||||
-rw-r--r-- | sys/dev/re/if_re.c | 2 | ||||
-rw-r--r-- | sys/dev/tdfx/tdfx_pci.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/net/if_ruereg.h | 5 | ||||
-rw-r--r-- | sys/dev/usb/serial/u3g.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/usbdevs | 2 | ||||
-rw-r--r-- | sys/dev/xl/if_xl.c | 25 |
17 files changed, 108 insertions, 41 deletions
diff --git a/sys/dev/drm/drmP.h b/sys/dev/drm/drmP.h index af50893..3b121e7 100644 --- a/sys/dev/drm/drmP.h +++ b/sys/dev/drm/drmP.h @@ -80,7 +80,9 @@ struct drm_file; #include <machine/pmap.h> #include <machine/bus.h> #include <machine/resource.h> +#if defined(__i386__) || defined(__amd64__) #include <machine/specialreg.h> +#endif #include <machine/sysarch.h> #include <sys/endian.h> #include <sys/mman.h> @@ -246,20 +248,20 @@ typedef u_int8_t u8; *(volatile u_int8_t *)(((vm_offset_t)(map)->virtual) + \ (vm_offset_t)(offset)) #define DRM_READ16(map, offset) \ - *(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) + \ - (vm_offset_t)(offset)) + le16toh(*(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) + \ + (vm_offset_t)(offset))) #define DRM_READ32(map, offset) \ - *(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) + \ - (vm_offset_t)(offset)) + le32toh(*(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) + \ + (vm_offset_t)(offset))) #define DRM_WRITE8(map, offset, val) \ *(volatile u_int8_t *)(((vm_offset_t)(map)->virtual) + \ (vm_offset_t)(offset)) = val #define DRM_WRITE16(map, offset, val) \ *(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) + \ - (vm_offset_t)(offset)) = val + (vm_offset_t)(offset)) = htole16(val) #define DRM_WRITE32(map, offset, val) \ *(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) + \ - (vm_offset_t)(offset)) = val + (vm_offset_t)(offset)) = htole32(val) #define DRM_VERIFYAREA_READ( uaddr, size ) \ (!useracc(__DECONST(caddr_t, uaddr), size, VM_PROT_READ)) diff --git a/sys/dev/drm/drm_agpsupport.c b/sys/dev/drm/drm_agpsupport.c index 7019fe7..cb98ec1 100644 --- a/sys/dev/drm/drm_agpsupport.c +++ b/sys/dev/drm/drm_agpsupport.c @@ -318,7 +318,7 @@ int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request) if (!dev->agp || !dev->agp->acquired) return EINVAL; - DRM_DEBUG("agp_bind, page_size=%x\n", PAGE_SIZE); + DRM_DEBUG("agp_bind, page_size=%x\n", (int)PAGE_SIZE); entry = drm_agp_lookup_entry(dev, (void *)request->handle); if (entry == NULL || entry->bound) diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c index 8d9bc69..75902a7 100644 --- a/sys/dev/drm/drm_drv.c +++ b/sys/dev/drm/drm_drv.c @@ -478,7 +478,7 @@ static int drm_load(struct drm_device *dev) retcode = ENOMEM; goto error; } - if (dev->agp != NULL) { + if (dev->agp != NULL && dev->agp->info.ai_aperture_base != 0) { if (drm_mtrr_add(dev->agp->info.ai_aperture_base, dev->agp->info.ai_aperture_size, DRM_MTRR_WC) == 0) dev->agp->mtrr = 1; diff --git a/sys/dev/drm/drm_memory.c b/sys/dev/drm/drm_memory.c index 415b774..409ea7d 100644 --- a/sys/dev/drm/drm_memory.c +++ b/sys/dev/drm/drm_memory.c @@ -73,7 +73,7 @@ void drm_mem_uninit(void) void *drm_ioremap_wc(struct drm_device *dev, drm_local_map_t *map) { - return pmap_mapdev_attr(map->offset, map->size, PAT_WRITE_COMBINING); + return pmap_mapdev_attr(map->offset, map->size, VM_MEMATTR_WRITE_COMBINING); } void *drm_ioremap(struct drm_device *dev, drm_local_map_t *map) diff --git a/sys/dev/drm/drm_sysctl.c b/sys/dev/drm/drm_sysctl.c index 4d9b0e8..1366b07 100644 --- a/sys/dev/drm/drm_sysctl.c +++ b/sys/dev/drm/drm_sysctl.c @@ -259,7 +259,7 @@ static int drm_bufs_info DRM_SYSCTL_HANDLER_ARGS *(1 << dma->bufs[i].page_order), (dma->bufs[i].seg_count * (1 << dma->bufs[i].page_order)) - * PAGE_SIZE / 1024); + * (int)PAGE_SIZE / 1024); } DRM_SYSCTL_PRINT("\n"); for (i = 0; i < dma->buf_count; i++) { diff --git a/sys/dev/drm/radeon_cs.c b/sys/dev/drm/radeon_cs.c index 14fe2fc..6dd82a2 100644 --- a/sys/dev/drm/radeon_cs.c +++ b/sys/dev/drm/radeon_cs.c @@ -765,7 +765,7 @@ static int r600_cs_parse(struct drm_radeon_cs_parser *parser) memcpy(parser->ib, ib_chunk->kdata, ib_chunk->length_dw * sizeof(uint32_t)); /* read back last byte to flush WC buffers */ - rb = readl(((vm_offset_t)parser->ib + (ib_chunk->length_dw-1) * sizeof(uint32_t))); + rb = *(volatile u_int32_t *) (((vm_offset_t)parser->ib + (ib_chunk->length_dw-1) * sizeof(uint32_t))); return 0; } diff --git a/sys/dev/firewire/00README b/sys/dev/firewire/00README index a6536ae..1abaa33 100644 --- a/sys/dev/firewire/00README +++ b/sys/dev/firewire/00README @@ -44,10 +44,6 @@ IEEE 1394 support for FreeBSD-5.X and 4.X. - make install - make load - For FreeBSD-4 user: - - - ./MAKEDEV - 3. SBP-II support (sbp) - You need CAM(SCSI) support in your kernel. diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 96947d4..58adc53 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -154,15 +154,19 @@ static int detect_hs21(struct bce_softc *bce_sc) { char *sysenv; - - if (bce_sc->bce_chipid != HS21_BCM_CHIPID) - return (0); - sysenv = getenv("smbios.system.product"); - if (sysenv == NULL) - return (0); - if (strncmp(sysenv, HS21_PRODUCT_ID, strlen(HS21_PRODUCT_ID)) != 0) - return (0); - return (1); + int found; + + found = 0; + if (bce_sc->bce_chipid == HS21_BCM_CHIPID) { + sysenv = getenv("smbios.system.product"); + if (sysenv != NULL) { + if (strncmp(sysenv, HS21_PRODUCT_ID, + strlen(HS21_PRODUCT_ID)) == 0) + found = 1; + freeenv(sysenv); + } + } + return (found); } /* Search for our PHY in the list of known PHYs */ diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 79378f5..3df5dfa 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -438,6 +438,9 @@ mii_attach(device_t dev, device_t *miibus, struct ifnet *ifp, rv = bus_generic_attach(dev); if (rv != 0) goto fail; + + /* Attaching of the PHY drivers is done in miibus_attach(). */ + return (0); } rv = bus_generic_attach(*miibus); if (rv != 0) diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h index f095bbf..cf72194 100644 --- a/sys/dev/mpt/mpt.h +++ b/sys/dev/mpt/mpt.h @@ -1112,10 +1112,10 @@ do { \ mpt_prt(mpt, __VA_ARGS__); \ } while (0) -#define mpt_lprtc(mpt, level, ...) \ -do { \ - if (level <= (mpt)->debug_level) \ - mpt_prtc(mpt, __VA_ARGS__); \ +#define mpt_lprtc(mpt, level, ...) \ +do { \ + if (level <= (mpt)->verbose) \ + mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #else void mpt_lprt(struct mpt_softc *, int, const char *, ...) diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c index fcc11c2..c77a4da 100644 --- a/sys/dev/nfe/if_nfe.c +++ b/sys/dev/nfe/if_nfe.c @@ -77,6 +77,7 @@ static int nfe_detach(device_t); static int nfe_suspend(device_t); static int nfe_resume(device_t); static int nfe_shutdown(device_t); +static int nfe_can_use_msix(struct nfe_softc *); static void nfe_power(struct nfe_softc *); static int nfe_miibus_readreg(device_t, int, int); static int nfe_miibus_writereg(device_t, int, int, int); @@ -383,6 +384,13 @@ nfe_attach(device_t dev) "max. width of link(x%d)\n", width, v); } + if (nfe_can_use_msix(sc) == 0) { + device_printf(sc->nfe_dev, + "MSI/MSI-X capability black-listed, will use INTx\n"); + msix_disable = 1; + msi_disable = 1; + } + /* Allocate interrupt */ if (msix_disable == 0 || msi_disable == 0) { if (msix_disable == 0 && @@ -784,6 +792,48 @@ nfe_resume(device_t dev) } +static int +nfe_can_use_msix(struct nfe_softc *sc) +{ + static struct msix_blacklist { + char *maker; + char *product; + } msix_blacklists[] = { + { "ASUSTeK Computer INC.", "P5N32-SLI PREMIUM" } + }; + + struct msix_blacklist *mblp; + char *maker, *product; + int count, n, use_msix; + + /* + * Search base board manufacturer and product name table + * to see this system has a known MSI/MSI-X issue. + */ + maker = getenv("smbios.planar.maker"); + product = getenv("smbios.planar.product"); + use_msix = 1; + if (maker != NULL && product != NULL) { + count = sizeof(msix_blacklists) / sizeof(msix_blacklists[0]); + mblp = msix_blacklists; + for (n = 0; n < count; n++) { + if (strcmp(maker, mblp->maker) == 0 && + strcmp(product, mblp->product) == 0) { + use_msix = 0; + break; + } + mblp++; + } + } + if (maker != NULL) + freeenv(maker); + if (product != NULL) + freeenv(product); + + return (use_msix); +} + + /* Take PHY/NIC out of powerdown, from Linux */ static void nfe_power(struct nfe_softc *sc) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 35326cb..4df624b 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -1449,7 +1449,7 @@ re_attach(device_t dev) if (sc->rl_type == RL_8169) phy = 1; error = mii_attach(dev, &sc->rl_miibus, ifp, re_ifmedia_upd, - re_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + re_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c index 7ed00ac..770c672 100644 --- a/sys/dev/tdfx/tdfx_pci.c +++ b/sys/dev/tdfx/tdfx_pci.c @@ -250,7 +250,7 @@ tdfx_attach(device_t dev) { /* * make_dev registers the cdev to access the 3dfx card from /dev * use hex here for the dev num, simply to provide better support if > 10 - * voodoo cards, for the mad. The user must set the link, or use MAKEDEV. + * voodoo cards, for the mad. The user must set the link. * Why would we want that many voodoo cards anyhow? */ tdfx_info->devt = make_dev(&tdfx_cdev, device_get_unit(dev), diff --git a/sys/dev/usb/net/if_ruereg.h b/sys/dev/usb/net/if_ruereg.h index a4a4aec..c90a969 100644 --- a/sys/dev/usb/net/if_ruereg.h +++ b/sys/dev/usb/net/if_ruereg.h @@ -157,11 +157,6 @@ struct rue_intrpkt { uint8_t rue_col_cnt; } __packed; -struct rue_type { - uint16_t rue_vid; - uint16_t rue_did; -}; - enum { RUE_BULK_DT_WR, RUE_BULK_DT_RD, diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 0777cdd..646063a 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -288,6 +288,7 @@ static const struct usb_device_id u3g_devs[] = { U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, K3765_INIT, U3GINIT_HUAWEISCSI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), @@ -457,6 +458,7 @@ static const struct usb_device_id u3g_devs[] = { U3G_DEV(SIERRA, MC5727, 0), U3G_DEV(SIERRA, MC5727_2, 0), U3G_DEV(SIERRA, MC5728, 0), + U3G_DEV(SIERRA, MC8700, 0), U3G_DEV(SIERRA, MC8755, 0), U3G_DEV(SIERRA, MC8755_2, 0), U3G_DEV(SIERRA, MC8755_3, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 87350a7..91fe9f4 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1857,6 +1857,7 @@ product HUAWEI E143F 0x143f 3G modem product HUAWEI E1752 0x1446 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E14AC 0x14ac 3G modem +product HUAWEI K3765_INIT 0x1520 HUAWEI Mobile K3765 Initial /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g @@ -2919,6 +2920,7 @@ product SIERRA C888 0x6890 C888 product SIERRA C22 0x6891 C22 product SIERRA E6892 0x6892 E6892 product SIERRA E6893 0x6893 E6893 +product SIERRA MC8700 0x68A3 MC8700 product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index d99109f..ad54d79 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -555,6 +555,7 @@ xl_miibus_statchg(device_t dev) { struct xl_softc *sc; struct mii_data *mii; + uint8_t macctl; sc = device_get_softc(dev); mii = device_get_softc(sc->xl_miibus); @@ -563,11 +564,22 @@ xl_miibus_statchg(device_t dev) /* Set ASIC's duplex mode to match the PHY. */ XL_SEL_WIN(3); - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) - CSR_WRITE_1(sc, XL_W3_MAC_CTRL, XL_MACCTRL_DUPLEX); - else - CSR_WRITE_1(sc, XL_W3_MAC_CTRL, - (CSR_READ_1(sc, XL_W3_MAC_CTRL) & ~XL_MACCTRL_DUPLEX)); + macctl = CSR_READ_1(sc, XL_W3_MAC_CTRL); + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + macctl |= XL_MACCTRL_DUPLEX; + if (sc->xl_type == XL_TYPE_905B) { + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_RXPAUSE) != 0) + macctl |= XL_MACCTRL_FLOW_CONTROL_ENB; + else + macctl &= ~XL_MACCTRL_FLOW_CONTROL_ENB; + } + } else { + macctl &= ~XL_MACCTRL_DUPLEX; + if (sc->xl_type == XL_TYPE_905B) + macctl &= ~XL_MACCTRL_FLOW_CONTROL_ENB; + } + CSR_WRITE_1(sc, XL_W3_MAC_CTRL, macctl); } /* @@ -1464,7 +1476,8 @@ xl_attach(device_t dev) if ((sc->xl_flags & XL_FLAG_PHYOK) == 0) phy = 24; error = mii_attach(dev, &sc->xl_miibus, ifp, xl_ifmedia_upd, - xl_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + xl_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, + sc->xl_type == XL_TYPE_905B ? MIIF_DOPAUSE : 0); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; |