2263 Commits

Author SHA1 Message Date
jhb
672ab68dc7 MFC: Fixup locking and mark MPSAFE. 2005-11-15 19:59:04 +00:00
jkim
93c90b8175 MFC: agp_amd64 1.8, 1.9 and agpreg.h 1.15.
- Add a work-around for nForce3, ULi, and VIA chipsets.  Aperture base
address encoded in misc. control register and AGP bridge seems to be
inconsistent with some BIOSes.  Instead of relying on BIOS settings,
we just take the initial aperture size and encode them for both
miscellaneous control register and AGP bridge.

- Add preliminary ULi M1689 chipset support.  The idea was taken from Linux
because hardware and documentation are unavailable.  Not tested.

- Add one more VIA chipset PCI ID taken from Linux driver.
2005-11-14 22:48:30 +00:00
anholt
fe7e62c722 MFC: ATI IGP AGP driver. 2005-11-14 21:14:14 +00:00
anholt
efd8d6d5f0 MFC r1.9: Fix nforce2 with Radeon DRI by setting bits to set the mappings
active, and use volatile in a necessary place.
2005-11-14 21:10:39 +00:00
jhb
9bab8bbba1 MFC: Sync this driver up with HEAD including bus-dma support and some other
cleanups such as removing some more old cruft and using kernel functions
like m_defrag() and m_devget() rather than homerolling our own.
2005-11-14 19:29:56 +00:00
jhb
f135674de1 MFC:
- Use if_printf() and device_printf() and remove vr_unit from the softc.
  I had to initialize the ifnet a bit earlier in attach so that the
  if_printf()'s in vr_reset() didn't explode with a page fault.
- Use M_ZERO with contigmalloc() rather than an explicit bzero.
- Use callout_*() to manage the callout and make it MPSAFE.
- Fix locking in detach(), we only need to lock across vr_stop().
2005-11-08 16:05:56 +00:00
jhb
32326c2058 MFC: Add the device ID for the VIA VT8235 south bridge. 2005-11-08 15:57:39 +00:00
jhb
6556c6267c MFC: If the viapm device is a PCI-ISA bridge, attach a child ISA bus. 2005-11-08 15:55:30 +00:00
jhb
67ef65a00c MFC: Only allow the sk(4) driver to attach to revision 2 of the LinkSys
EG1032 cards and teach the re(4) driver to attach to revision 3 cards.
2005-11-06 16:00:54 +00:00
delphij
3527f35222 MFC (by ru)
| Fix "struct ifnet" leaks when attach() fails in the middle, e.g.
| when mii_phy_probe() or bus_setup_intr() fails.  For drivers that
| call their detach() in this case, call if_free() there to cover
| this case too.
|
| Revision  Changes    Path
| 1.168     +2 -2      src/sys/pci/if_dc.c
| 1.75      +2 -2      src/sys/pci/if_pcn.c
| 1.156     +3 -5      src/sys/pci/if_rl.c (already merged)
| 1.87      +2 -2      src/sys/pci/if_sf.c
| 1.136     +2 -3      src/sys/pci/if_sis.c
| 1.110     +2 -3      src/sys/pci/if_sk.c
| 1.89      +2 -2      src/sys/pci/if_ste.c
| 1.110     +2 -2      src/sys/pci/if_ti.c
| 1.103     +2 -2      src/sys/pci/if_tl.c
| 1.107     +2 -2      src/sys/pci/if_vr.c
| 1.83      +2 -2      src/sys/pci/if_wb.c
| 1.196     +2 -2      src/sys/pci/if_xl.c

Approved by:	re (scottl)
2005-10-09 04:11:20 +00:00
glebius
97d261903e Big overall MFC of polling(4) cleanup:
o First attempt on removing Giant from polling. Details:
  http://lists.freebsd.org/pipermail/cvs-src/2005-September/051848.html
o Second attempt, and big polling cleanup including:
  - Functinal approach to turning polling on/off
  - Deprecating of poll_in_trap
  - Removal of ifnet knowledge from kern_poll.c
  Details:
  http://lists.freebsd.org/pipermail/cvs-src/2005-October/053267.html
o Improved checking of user configurable sysctls. Details:
  http://lists.freebsd.org/pipermail/cvs-src/2005-October/053351.html
o Moving DEVICE_POLLING from opt_global.h to opt_device_polling.h:
  http://lists.freebsd.org/pipermail/cvs-src/2005-October/053479.html

o All related documentation fixes.

Approved by:	re (kensmith)
Thanks to:	everyone, who helped with testing
2005-10-07 14:00:06 +00:00
jhb
8e6918f435 MFC: Fixup locking in rl(4) and re(4).
Approved by:	re (scottl)
2005-10-06 20:17:17 +00:00
jhb
81459002f4 MFC various fixes to sis(4):
- Remove sis_unit and use device_printf() and if_printf() instead.
- Use callout_init_mtx() for the callout.
- Remove spls.
- Fix locking for ifmedia to happen in the ifmedia handlers rather than in
  sis_ioctl().

Approved by:	re (scottl)
2005-09-29 18:52:21 +00:00
jhb
02ea2b090c MFC: Fixup locking and mark MPSAFE.
Approved by:	re (kensmith)
2005-09-26 19:36:38 +00:00
keramida
bad3bd7ff4 MFC 1.167: panic on attach failure...
% When bus_alloc_resource_any() fails, dc_detach() is called and it
% attempts to deallocate busdma tags and resources that haven't been
% allocated yet, causing a panic every time a dc interface fails to
% attach.  Fix by checking that we really have something to dealloc
% before calling bus_dma*() functions.
%
% Approved by:    jhb
% MFC after:      1 week

Approved by:	re (kensmith)
2005-09-22 12:46:01 +00:00
jhb
e0440d1c00 MFC: Use if_printf() and device_printf().
Approved by:	re (kensmith)
2005-09-21 21:06:39 +00:00
cvs2svn
21f17fbdbc This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-09-17 03:36:48 +00:00
jhb
b84a032305 MFC: Fixup locking and mark MPSAFE.
Approved by:	re (kensmith)
2005-09-15 19:16:29 +00:00
jhb
f669c46b33 MFC: Conditionally lock Giant in xl's taskqueue handler function.
Approved by:	re (scottl)
2005-08-26 15:31:09 +00:00
jhb
7d4d674c95 MFC: Use if_printf() and device_printf() and remove ste_unit from the
softc.

Approved by:	re (scottl)
2005-08-26 15:27:23 +00:00
jhb
e878090f8a MFC: Fix up locking and mark MPSAFE.
Approved by:	re (scottl)
2005-08-26 14:52:36 +00:00
jhb
2bcd5cdce1 MFC: Fixup locking including moving the taskqueue_drain() out of xl_stop().
Approved by:	re (scottl)
2005-08-26 14:46:22 +00:00
jhb
d15690f22e MFC: Fix up the locking in pcn(4) and mark it MPSAFE.
Approved by:	re (scottl)
2005-08-26 14:33:05 +00:00
bz
19636d5e3c MFC rev. 1.109:
* Solve "No PHY found" problem for more Yukon Lite variants.
   * Catch a bus attach error.
   * Improve locking.
   (missing in original commit message but was not worth a forced commit):
   * put interrupt moderation messages under bootverbose

Approved by:	re (kensmith)
2005-08-26 10:46:20 +00:00
rwatson
e13b2df854 Merge linux_ioctl.c:1.128 svr4_sockio.c:1.17 altq_cbq.c:1.3 if_oltr.c:1.38
if_pflog.c:1.14 if_pfsync.c:1.21 if_an.c:1.70 if_ar.c:1.72 if_arl.c:1.11
amrr.c:1.10 onoe.c:1.10 if_ath.c:1.101 awi.c:1.41 if_bfe.c:1.27
if_bge.c:1.93 if_cm_isa.c:1.7 smc90cx6.c:1.16 if_cnw.c:1.20 if_cp.c:1.25
if_cs.c:1.42 if_ct.c:1.26 if_cx.c:1.46 if_ed.c:1.256 if_em.c:1.68
if_en_pci.c:1.37 midway.c:1.66 if_ep.c:1.143 if_ex.c:1.58 if_fatm.c:1.20
if_fe.c:1.93 if_fwe.c:1.38 if_fwip.c:1.8 if_fxp.c:1.244 if_gem.c:1.33
if_hatm.c:1.25 if_hatm_intr.c:1.20 if_hatm_ioctl.c:1.13 if_hatm_rx.c:1.10
if_hatm_tx.c:1.14 if_hme.c:1.39 if_ie.c:1.104 if_ndis.c:1.101
if_ic.c:1.24 if_ipw.c:1.10 if_iwi.c:1.10 if_ixgb.c:1.13 if_lge.c:1.41
if_lnc.c:1.113 if_my.c:1.31 if_nge.c:1.77 if_nve.c:1.10 if_owi.c:1.12
if_patm.c:1.9 if_patm_intr.c:1.6 if_patm_ioctl.c:1.10 if_patm_tx.c:1.10
pdq_ifsubr.c:1.28 if_plip.c:1.38 if_ral.c:1.12 if_ral_pci.c:1.2
if_ray.c:1.81 if_rayvar.h:1.22 if_re.c:1.49 if_sbni.c:1.21 if_sbsh.c:1.14
if_sn.c:1.48 dp83932.c:1.21 if_snc_pccard.c:1.9 if_sr.c:1.70 if_tx.c:1.91
if_txp.c:1.33 if_aue.c:1.92 if_axe.c:1.32 if_cdce.c:1.8 if_cue.c:1.59
if_kue.c:1.66 if_rue.c:1.23 if_udav.c:1.16 if_ural.c:1.12 if_vge.c:1.16
if_vx.c:1.58 if_wi.c:1.185 if_wi_pci.c:1.26 if_wl.c:1.68 if_xe.c:1.60
if_xe_pccard.c:1.30 if_el.c:1.68 i4b_ipr.c:1.35 i4b_isppp.c:1.31
kern_poll.c:1.20 bridge.c:1.94 bridgestp.c:1.4 if_arcsubr.c:1.27
if_atm.h:1.24 if_atmsubr.c:1.40 if_bridge.c:1.16 if_ef.c:1.35
if_ethersubr.c:1.196 if_faith.c:1.37 if_fddisubr.c:1.100 if_fwsubr.c:1.14
if_gif.c:1.54 if_gre.c:1.34 if_iso88025subr.c:1.70 if_loop.c:1.107
if_ppp.c:1.106 if_spppsubr.c:1.121 if_tap.c:1.57 if_tun.c:1.154
if_vlan.c:1.80 ppp_tty.c:1.67 ieee80211_ioctl.c:1.32 atm_if.c:1.31
ng_eiface.c:1.33 ng_ether.c:1.50 ng_fec.c:1.19 ng_iface.c:1.44
ng_sppp.c:1.9 ip_carp.c:1.30 ip_fastfwd.c:1.30 in6.c:1.53 nd6_nbr.c:1.31
natm.c:1.40 if_dc.c:1.162 if_de.c:1.168 if_pcn.c:1.72 if_rl.c:1.154
if_sf.c:1.84 if_sis.c:1.135 if_sk.c:1.108 if_ste.c:1.86 if_ti.c:1.109
if_tl.c:1.101 if_vr.c:1.106 if_wb.c:1.81 if_xl.c:1.194 from HEAD to
RELENG_6:

  Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
  IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
  ifnet.if_drv_flags.  Device drivers are now responsible for
  synchronizing access to these flags, as they are in if_drv_flags.  This
  helps prevent races between the network stack and device driver in
  maintaining the interface flags field.

  Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
  some less so.

  Reviewed by:    pjd, bz

Approved by:	re (scottl)
2005-08-25 05:01:24 +00:00
rwatson
091aba35eb Merge if_ath.c:1.99 awi.c:1.39 if_bfe.c:1.26 if_bge.c:1.92 if_ed.c:1.255
if_em.c:1.67 if_ex.c:1.57 if_fe.c:1.92 if_fxp.c:1.242 if_gem.c:1.32
if_hme.c:1.38 if_ie.c:1.103 if_ndis.c:1.100 if_ixgb.c:1.12 if_lge.c:1.40
if_lnc.c:1.112 if_my.c:1.30 if_nge.c:1.76 if_nve.c:1.9 if_owi.c:1.11
pdq_ifsubr.c:1.27 if_ray.c:1.80 if_re.c:1.47 if_sn.c:1.47 dp83932.c:1.20
if_tx.c:1.90 if_txp.c:1.32 if_aue.c:1.91 if_axe.c:1.31 if_cue.c:1.58
if_kue.c:1.65 if_rue.c:1.22 if_udav.c:1.15 if_vge.c:1.15 if_wi.c:1.182
if_wl.c:1.67 if_xe.c:1.58 if_dc.c:1.161 if_de.c:1.167 if_pcn.c:1.70
if_rl.c:1.153 if_sf.c:1.83 if_sis.c:1.134 if_sk.c:1.107 if_ste.c:1.85
if_ti.c:1.108 if_tl.c:1.100 if_vr.c:1.105 if_wb.c:1.80 if_xl.c:1.193
from HEAD to RELENG_6:

  Modify device drivers supporting multicast addresses to lock if_addr_mtx
  over iteration of their multicast address lists when synchronizing the
  hardware address filter with the network stack-maintained list.

  Problem reported by:    Ed Maste (emaste at phaedrus dot sandvine dot ca>

Approved by:	re (scottl)
2005-08-24 16:50:46 +00:00
tobez
e539dc2e3b MFC: Recognize D-Link DGE-528(T) Gigabit as an re(4) device.
Approved by:	re (kensmith)
2005-08-15 14:02:37 +00:00
jhb
f3790ed7c5 MFC: Call tulip_start() rather than tulip_ifstart() from the interrupt
handler to avoid recursing on the driver lock.

Approved by:	re (kensmith)
2005-08-12 17:57:38 +00:00
jhb
ec1f68015f MFC: Various and sundry cleanups to remove old code and fix cruftiness.
Also, add locking and mark the driver as MPSAFE.

Approved by:	re (kensmith)
2005-08-05 19:07:19 +00:00
jhb
c429bc012d MFC: Fix a typo in the name of a dmamap for a bus_dmamap_sync().
Approved by:	re (kensmith)
2005-08-04 16:44:17 +00:00
mlaier
13c7295984 ALTQify ste(4).
Requested and tested by:	<nike_d at cytexbg dot com>
Approved by:			re (scottl)
2005-07-08 13:05:59 +00:00
scottl
5b31b99954 Fix ifnet fallout in if_ti.
Reviewed by: brooks
Approved by: re
2005-07-07 01:05:45 +00:00
anholt
991a0a9632 Make the initialization in the AGPv3 case match that of Linux. Fixes hangs on
X startup with DRI enabled, with a v3-capable card.

Tested by:	Tom McLaughlin <tmclaugh@sdf.lonestar.org>
Approved by:	re (scottl)
2005-06-26 04:01:11 +00:00
brooks
c9630d0c6a Move if_alloc() up so it's before mii_phy_probe(). 2005-06-11 01:37:46 +00:00
brooks
567ba9b00a Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam
2005-06-10 16:49:24 +00:00
nyan
0fce92f5c4 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
glebius
a74a3160f2 Calling xl_rxeof() at the end of xl_start_locked() leads to recursion
in case of IP fast forwarding. Enqueue a taskqueue(9) task instead of
calling xl_rxeof() directly.

Reported & tested by:	Slava Alpatov
Reviewed by:		wpaul
MFC after:		1 week
2005-05-20 07:16:09 +00:00
bz
cd218c4d5b Deal with failed malloc calls[1].
While there also check for failed device_add_child calls.

Found by:	Coventry Analysis tool[1].
Submitted by:	sam[1]
Approved by:	pjd (mentor)
MFC after:	1 week
2005-04-25 10:18:24 +00:00
imp
9052714aec Fix newer Xircom CBE2-100 cards that were reporting
dc0: MII without any PHY!
We have to enable the connection to the MII first.  Doing so fixes the
problem cards without breaking the older, working cards.

Bad card provided by: deischen
2005-04-18 03:31:29 +00:00
mdodd
4d0827c517 Invert conditional and use continue to reduce nesting. 2005-04-13 01:32:06 +00:00
obrien
68ad6f8bd2 Add nForce3-250. 2005-04-08 18:04:39 +00:00
obrien
3cc412b783 nVidia AGP chipsets beyond nForce2 are AMD64-specific.
So move the AGP support to there.

Submitted by:	Jung-uk Kim <jkim@niksun.com>
2005-04-02 01:10:09 +00:00
scottl
ea294a1122 If resource allocation fails, we could wind up freeing the cdev without it
being allocated.  Add a simple check for this.

Submitted by: yongari
2005-03-31 17:16:40 +00:00
obrien
613b483802 Bring rev 1.31 to the AMD64 platform.
This adds support for the SiS intergrated NIC on some Athlon64 motherboards.
The MAC address is stored in the APC CMOS RAM and this fixes the
sis driver ending up with a 00:00:00:00:00:00 MAC address.

Submitted by:	Stasys Smailys <ssmailys@komvista.lt>
2005-03-28 18:06:44 +00:00
sam
162ad543c2 deal with malloc failure when setting up the multicast filter
Noticed by:	Coverity Prevent analysis tool
2005-03-26 23:26:49 +00:00
sam
238c96d5e4 handle malloc failure and sk_vpd_prodname potentially being null for
other reasons

Noticed by:	Coverity Prevent analysis tool
Reviewed by:	bz, jmg
2005-03-26 22:57:28 +00:00
ru
004ebb83ce xl(4) meets polling(4). Hardware for this work kindly provided by
Eric Masson.

MFC after:	3 weeks
2005-03-26 20:22:58 +00:00
scottl
677dba2c50 Start the process of modernizing the Tigon driver by using busdma for the
descriptor and configuration data.  Thanks to Martin Nilsson for providing
hardware.
2005-03-21 07:17:27 +00:00
bz
63691d918e Do not try to free non allocated memory in error case.
Do our best to plug some memory leaks (VPD data, jumbo memory buffer,...).
Log if we cannot free because memory still in use[1].
Change locking to avoid ''acquiring duplicate lock of same
  type: "network driver"'' and potential deadlock. Also seems to fix LOR #063.

[1] This change does not solve problems if buffers are still in use when
    unloading if_sk.ko. There is ongoing work which will address jumbogram
    allocations in a more general way.

PR:		kern/75677 (with changes, no mii fixes in here)
Tested by:	net, Antoine Brodin (slightly different version)
Approved by:	rwatson (mentor)
MFC after:	5 days
2005-03-17 14:27:22 +00:00
bz
e2f49ebf07 * Lower interrupt moderation timer 200->100.
Obtained from:	NetBSD if_sk.c rev. 1.11

* Make interrupt moderation configurable via sysctl/tuneable.
PR:		kern/41220
Approved by:	rwatson (mentor)
2005-03-17 14:23:13 +00:00