2276 Commits

Author SHA1 Message Date
jhb
f59079c372 MFC: Add device ID for the Neteasy DRP-32TXD cardbus 10/100 card.
Approved by:	re (hrs)
2006-03-21 21:10:58 +00:00
glebius
f90db41611 MFC:
Do not touch ifp->if_baudrate in miibus aware drivers.

Approved by:	re (scottl)
2006-03-17 21:30:57 +00:00
bz
2c125a1727 MFC rev. 1.115:
Remove unused code.
Found with:	Coverity Prevent(tm)
2006-01-27 21:37:56 +00:00
glebius
00dc285d46 Check ifp before dereferencing it in xl_detach(). xl_detach() can be called
from xl_attach(), when ifp is not defined yet.

Found with:	Coverity Prevent(tm)
2006-01-18 09:42:21 +00:00
glebius
e9cbabbbdd - Restore VLAN_INPUT_TAG() macro to preserve API compatibility for
third party drivers.
- Fix bugs destribed in previous revision using macro with
  another name.
2006-01-14 10:05:07 +00:00
glebius
ed67dec936 MFC:
- Use VLAN_TAG_VALUE() not only to read a dot1q tag
    value from an m_tag, but also to set it.  This reduces
    complex code duplication and improves its readability.
  - Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag in
    case if memory allocation failed.
  - Remove fourth argument from VLAN_INPUT_TAG(), that was used
    incorrectly in almost all drivers. Indicate failure with
    mbuf value of NULL.
2006-01-13 11:51:11 +00:00
glebius
c374350f42 MFC:
Check for IFF_DRV_RUNNING in the interrupt loop.

  Reported & tested by:   Martin P. Hansen <mph lima.dyndns.dk>
2006-01-10 10:24:05 +00:00
bz
4e607a8b76 MFC:
rev. 1.111 date: 2005/10/11 22:55:16; author: yar  sys/pci/if_sk.c
rev. 1.28  date: 2005/10/11 22:59:01; author: yar  share/man/man4/vlan.4

Mark sk(4) capable of handling extended VLAN frames.

PR: kern/79998
2005-12-30 20:13:46 +00:00
jhb
01364d3f00 MFC: Destroy the /dev device before destroying the mutex or
releasing resources.
2005-12-28 16:52:45 +00:00
ru
1898f8a6fe MFC: 1.17: Fix PCI ID of the AMD-8111 System Management controller
that provides SMBus 1.0 function that this driver supports.
2005-12-21 11:00:53 +00:00
anholt
7e2effb167 MFC i915 GMCH AGP support. 2005-12-14 00:47:25 +00:00
anholt
f4f7767dd8 MFC r1.28: Add support for the i855GM. 2005-12-14 00:46:23 +00:00
jhb
b37ccdba12 MFC: Let ether_ioctl() handle SIOCSIFMTU. 2005-11-28 19:43:57 +00:00
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