The NetBSD Project

CVS log for src/sys/net/if_media.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / net

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.54 / (download) - annotate - [select for diffs], Sat Sep 3 02:47:59 2022 UTC (19 months, 2 weeks ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.53: +2 -3 lines
Diff to previous 1.53 (colored)

Garbage-collect the remaining vestiges of netisr.

Revision 1.53 / (download) - annotate - [select for diffs], Wed Oct 6 20:42:44 2021 UTC (2 years, 6 months ago) by andvar
Branch: MAIN
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

s/acccess/access/

Revision 1.36.2.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:15 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.36.2.1: +269 -82 lines
Diff to previous 1.36.2.1 (colored) to branchpoint 1.36 (colored) next main 1.37 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.52 / (download) - annotate - [select for diffs], Sun Mar 15 23:04:51 2020 UTC (4 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Changes since 1.51: +229 -59 lines
Diff to previous 1.51 (colored)

Define and implement a locking protocol for the ifmedia / mii layers:
- MP-safe drivers provide a mutex to ifmedia that is used to serialize
  access to media-related structures / hardware regsiters.  Converted
  drivers use the new ifmedia_init_with_lock() function for this.  The
  new name is provided to ease the transition.
- Un-converted drivers continue to call ifmedia_init(), which will supply
  a compatibility lock to be used instead.  Several media-related entry
  points must be aware of this compatibility lock, and are able to acquire
  it recursively a limited number of times, if needed.  This is a SPIN
  mutex with priority IPL_NET.
- This same lock is used to serialize access to PHY registers and other
  MII-related data structures.

The PHY drivers are modified to acquire and release the lock, as needed,
and assert the lock is held as a diagnostic aid.

The "usbnet" framework has had an overhaul of its internal locking
protocols to fit in with the media / mii changes, and the drivers adapted.

USB wifi drivers have been changed to provide their own adaptive mutex
to the ifmedia later via a new ieee80211_media_init_with_lock() function.
This is required because the USB drivers need an adaptive mutex.

Besised "usbnet", a few other drivers are converted: vmx, wm, ixgbe / ixv.

mcx also now calls ifmedia_init_with_lock() because it needs to also use
an adaptive mutex.  The mcx driver still needs to be fully converted to
NET_MPSAFE.

Revision 1.48.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:06 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.48.2.1: +45 -31 lines
Diff to previous 1.48.2.1 (colored) to branchpoint 1.48 (colored) next main 1.49 (colored)

Sync with head.

Revision 1.51 / (download) - annotate - [select for diffs], Sat Feb 1 20:56:16 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: ad-namecache-base3
Changes since 1.50: +16 -6 lines
Diff to previous 1.50 (colored)

- Add an ifmedia_fini() routine, to free resources assocated with
  an ifmedia.  Currently calls ifmedia_removeall().  All drivers
  that call ifmedia_init() and support detach should call this
  routine.
- In ifmedia_delete_instance(), set ifm->ifm_cur to NULL and
  ifm->ifm_media to IFM_NONE when removing / freeing that entry,
  not simply when we've been asked to delete every media instance.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Jan 31 00:49:18 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.49: +31 -27 lines
Diff to previous 1.49 (colored)

- Use kmem(9) instead of malloc(9).
- When handling SIOCGIFMEDIA, don't traverse the media list directly;
  refactor that out into a ifmedia_getwords() function.

Revision 1.48.2.1 / (download) - annotate - [select for diffs], Sat Jan 25 22:38:52 2020 UTC (4 years, 2 months ago) by ad
Branch: ad-namecache
Changes since 1.48: +13 -4 lines
Diff to previous 1.48 (colored)

Sync with head.

Revision 1.49 / (download) - annotate - [select for diffs], Mon Jan 20 19:35:39 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: ad-namecache-base2
Changes since 1.48: +13 -4 lines
Diff to previous 1.48 (colored)

In ifmedia_ioctl(), go to splnet() before acquiring the KERNEL_LOCK.
For non-NET_MPSAFE, this is benign, because we can nest raising to
splnet().  For the NET_MPSAFE, it means that drivers don't need to
raise to splnet() just in order to call ifmedia_ioctl().

Revision 1.48 / (download) - annotate - [select for diffs], Tue Oct 1 17:45:25 2019 UTC (4 years, 6 months ago) by chs
Branch: MAIN
CVS Tags: phil-wifi-20191119, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.47: +3 -9 lines
Diff to previous 1.47 (colored)

in ifmedia_add(), use a wait-style memory allocation rather than
not waiting and panic'ing if the allocation fails.

Reported-by: syzbot+249ca42197f0b066e154@syzkaller.appspotmail.com

Revision 1.47 / (download) - annotate - [select for diffs], Sat Aug 10 01:04:05 2019 UTC (4 years, 8 months ago) by mrg
Branch: MAIN
Changes since 1.46: +6 -6 lines
Diff to previous 1.46 (colored)

rename _ifmedia_ioctl() to ifmedia_ioctl_locked().

Revision 1.36.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:45 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.36: +31 -47 lines
Diff to previous 1.36 (colored)

Sync with HEAD

Revision 1.46 / (download) - annotate - [select for diffs], Tue May 21 09:18:37 2019 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Changes since 1.45: +3 -4 lines
Diff to previous 1.45 (colored)

 KNF. No functional change.

Revision 1.45 / (download) - annotate - [select for diffs], Fri May 17 07:37:12 2019 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.44: +5 -4 lines
Diff to previous 1.44 (colored)

 The max subtype of the ifmedia word is 31. It's too small for Ethernet now.
We currently use use it up to 30. We should extend the limit to be able to use
more than 10Gbps speeds. Our ifmedia(4) is inconvenience and have some problem
so we should redesign the interface, but it's too late for netbsd-9 to do it.
So, we keep the data structure size and modify the structure a bit. The
strategy is almost the same as FreeBSD. Many bits of IFM_OMASK for Ethernet
have not used, so use some of them for Ethernet's subtype.

The differences against FreeBSD are:
 - We use NetBSD style compat code (i.e. no SIOCGIFXMEDIA).
 - FreeBSD's IFM_ETH_XTYPE's bit location is from 11 to "14" even though
   IFM_OMASK is from 8 to "15". We use _IFM_ETH_XTMASK from bit 13 to "15".
 - FreeBSD changed the meaning of IFM_TYPE_MATCH(). I think we should
   not do it. We keep it not changing and added new IFM_TYPE_SUBTYPE_MATCH()
   macro for matching both TYPE and SUBTYPE.
 - Added up to 400GBASE-SR16.

New layout of the media word is as follows (from ifmedia_h):

 * if_media Options word:
 *	Bits	Use
 *	----	-------
 *	0-4	Media subtype	MAX SUBTYPE == 255 for ETH and 31 for others
 *	5-7	Media type
 *	8-15	Type specific options
 *	16-18	Mode (for multi-mode devices)
 *	19	(Reserved for Future Use)
 *	20-27	Shared (global) options
 *	28-31	Instance
 *
 *   3                     2                   1
 *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
 *  +-------+---------------+-+-----+---------------+-----+---------+
 *  |       |               |R|     |               |     |         |
 *  | IMASK |     GMASK     |F|MMASK+-----+ OMASK   |NMASK|  TMASK  |
 *  |       |               |U|     |XTMSK|         |     |         |
 *  +-------+---------------+-+-----+-----+---------+-----+---------+
 *   <----->                   <--->                 <--->
 *  IFM_INST()               IFM_MODE()            IFM_TYPE()
 *
 *                              IFM_SUBTYPE(other than ETH)<------->
 *
 *                                   <---> IFM_SUBTYPE(ETH)<------->
 *
 *
 *           <------------->         <------------->
 *                        IFM_OPTIONS()

Revision 1.32.6.3 / (download) - annotate - [select for diffs], Tue May 14 11:37:12 2019 UTC (4 years, 11 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.32.6.2: +5 -2 lines
Diff to previous 1.32.6.2 (colored) to branchpoint 1.32 (colored) next main 1.33 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1266):

	sys/net/if_media.c: revision 1.42 (via patch)

Add missing error check.

Revision 1.44 / (download) - annotate - [select for diffs], Fri May 10 08:24:54 2019 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.43: +4 -5 lines
Diff to previous 1.43 (colored)

Use %08x to print ifmedia word (IFMEDIA_DEBUG).

Revision 1.43 / (download) - annotate - [select for diffs], Tue Apr 23 07:29:04 2019 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.42: +8 -13 lines
Diff to previous 1.42 (colored)

 KNF. No functional change.

Revision 1.42 / (download) - annotate - [select for diffs], Mon Apr 22 11:10:52 2019 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.41: +4 -2 lines
Diff to previous 1.41 (colored)

 Add missing error check.

Revision 1.41 / (download) - annotate - [select for diffs], Tue Apr 16 06:48:33 2019 UTC (5 years ago) by msaitoh
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.40: +2 -13 lines
Diff to previous 1.40 (colored)

 It's not required (and can't do) to convert OSIOCSIFMEDIA in ifmedia_ioct()
because the conversiosn is done in doifioctl().

Revision 1.40 / (download) - annotate - [select for diffs], Wed Apr 10 08:23:46 2019 UTC (5 years ago) by msaitoh
Branch: MAIN
Changes since 1.39: +8 -7 lines
Diff to previous 1.39 (colored)

 KNF. No functional change.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Apr 10 08:22:18 2019 UTC (5 years ago) by msaitoh
Branch: MAIN
Changes since 1.38: +5 -3 lines
Diff to previous 1.38 (colored)

 Fix a bug that OSIOCSIFMEDIA can't treat. Add missing inclusion of
compat/sys/sockio.h.

Revision 1.38 / (download) - annotate - [select for diffs], Thu Feb 28 05:40:58 2019 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.37: +5 -6 lines
Diff to previous 1.37 (colored)

- Remove extra cast.
- Cosmetic change.

Revision 1.37 / (download) - annotate - [select for diffs], Thu Feb 28 05:25:35 2019 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.36: +8 -11 lines
Diff to previous 1.36 (colored)

No functional change:
 - Use TAILQ_FOREACH{,_SAFE}() macro.
 - KNF.

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Sat Apr 7 04:12:19 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.35: +19 -4 lines
Diff to previous 1.35 (colored) next main 1.36 (colored)

Sync with HEAD.  77 conflicts resolved - all of them $NetBSD$

Revision 1.36 / (download) - annotate - [select for diffs], Fri Mar 30 13:21:24 2018 UTC (6 years ago) by mlelstv
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407
Branch point for: phil-wifi
Changes since 1.35: +19 -4 lines
Diff to previous 1.35 (colored)

add prototypes, validate ifm_change and ifm_status vectors. NFC.

Revision 1.32.6.2 / (download) - annotate - [select for diffs], Tue Jan 2 10:20:33 2018 UTC (6 years, 3 months ago) by snj
Branch: netbsd-8
CVS Tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.32.6.1: +20 -4 lines
Diff to previous 1.32.6.1 (colored) to branchpoint 1.32 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #456):
	sys/arch/arm/sunxi/sunxi_emac.c: 1.9
	sys/dev/ic/dwc_gmac.c: 1.43-1.44
	sys/dev/pci/if_iwm.c: 1.75
	sys/dev/pci/if_wm.c: 1.543
	sys/dev/pci/ixgbe/ixgbe.c: 1.112
	sys/dev/pci/ixgbe/ixv.c: 1.74
	sys/kern/sys_socket.c: 1.75
	sys/net/agr/if_agr.c: 1.43
	sys/net/bpf.c: 1.219
	sys/net/if.c: 1.397, 1.399, 1.401-1.403, 1.406-1.410, 1.412-1.416
	sys/net/if.h: 1.242-1.247, 1.250, 1.252-1.257
	sys/net/if_bridge.c: 1.140 via patch, 1.142-1.146
	sys/net/if_etherip.c: 1.40
	sys/net/if_ethersubr.c: 1.243, 1.246
	sys/net/if_faith.c: 1.57
	sys/net/if_gif.c: 1.132
	sys/net/if_l2tp.c: 1.15, 1.17
	sys/net/if_loop.c: 1.98-1.101
	sys/net/if_media.c: 1.35
	sys/net/if_pppoe.c: 1.131-1.132
	sys/net/if_spppsubr.c: 1.176-1.177
	sys/net/if_tun.c: 1.142
	sys/net/if_vlan.c: 1.107, 1.109, 1.114-1.121
	sys/net/npf/npf_ifaddr.c: 1.3
	sys/net/npf/npf_os.c: 1.8-1.9
	sys/net/rtsock.c: 1.230
	sys/netcan/if_canloop.c: 1.3-1.5
	sys/netinet/if_arp.c: 1.255
	sys/netinet/igmp.c: 1.65
	sys/netinet/in.c: 1.210-1.211
	sys/netinet/in_pcb.c: 1.180
	sys/netinet/ip_carp.c: 1.92, 1.94
	sys/netinet/ip_flow.c: 1.81
	sys/netinet/ip_input.c: 1.362
	sys/netinet/ip_mroute.c: 1.147
	sys/netinet/ip_output.c: 1.283, 1.285, 1.287
	sys/netinet6/frag6.c: 1.61
	sys/netinet6/in6.c: 1.251, 1.255
	sys/netinet6/in6_pcb.c: 1.162
	sys/netinet6/ip6_flow.c: 1.35
	sys/netinet6/ip6_input.c: 1.183
	sys/netinet6/ip6_output.c: 1.196
	sys/netinet6/mld6.c: 1.90
	sys/netinet6/nd6.c: 1.239-1.240
	sys/netinet6/nd6_nbr.c: 1.139
	sys/netinet6/nd6_rtr.c: 1.136
	sys/netipsec/ipsec_output.c: 1.65
	sys/rump/net/lib/libnetinet/netinet_component.c: 1.9-1.10
kmem_intr_free kmem_intr_[z]alloced memory
the underlying pools are the same but api-wise those should match
Unify IFEF_*_MPSAFE into IFEF_MPSAFE
There are already two flags for if_output and if_start, however, it seems such
MPSAFE flags are eventually needed for all if_XXX operations. Having discrete
flags for each operation is wasteful of if_extflags bits. So let's unify
the flags into one: IFEF_MPSAFE.
Fortunately IFEF_*_MPSAFE flags have never been included in any releases, so
we can change them without breaking backward compatibility of the releases
(though the kernel version of -current should be bumped).
Note that if an interface have both MP-safe and non-MP-safe operations at a
time, we have to set the IFEF_MPSAFE flag and let callees of non-MP-safe
opeartions take the kernel lock.
Proposed on tech-kern@ and tech-net@
Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch
It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..."
scattered all over the source code and makes it easy to identify remaining
KERNEL_LOCK and/or softnet_lock that are held even if NET_MPSAFE.
No functional change
Hold KERNEL_LOCK on if_ioctl selectively based on IFEF_MPSAFE
If IFEF_MPSAFE is set, hold the lock and otherwise don't hold.
This change requires additions of KERNEL_LOCK to subsequence functions from
if_ioctl such as ifmedia_ioctl and ifioctl_common to protect non-MP-safe
components.
Proposed on tech-kern@ and tech-net@
Ensure to hold if_ioctl_lock when calling if_flags_set
Fix locking against myself on ifpromisc
vlan_unconfig_locked could be called with holding if_ioctl_lock.
Ensure to not turn on IFF_RUNNING of an interface until its initialization completes
And ensure to turn off it before destruction as per IFF_RUNNING's description
"resource allocated". (The description is a bit doubtful though, I believe the
change is still proper.)
Ensure to hold if_ioctl_lock on if_up and if_down
One exception for if_down is if_detach; in the case the lock isn't needed
because it's guaranteed that no other one can access ifp at that point.
Make if_link_queue MP-safe if IFEF_MPSAFE
if_link_queue is a queue to store events of link state changes, which is
used to pass events from (typically) an interrupt handler to
if_link_state_change softint. The queue was protected by KERNEL_LOCK so far,
but if IFEF_MPSAFE is enabled, it becomes unsafe because (perhaps) an interrupt
handler of an interface with IFEF_MPSAFE doesn't take KERNEL_LOCK. Protect it
by a spin mutex.
Additionally with this change KERNEL_LOCK of if_link_state_change softint is
omitted if NET_MPSAFE is enabled.
Note that the spin mutex is now ifp->if_snd.ifq_lock as well as the case of
if_timer (see the comment).
Use IFADDR_WRITER_FOREACH instead of IFADDR_READER_FOREACH
At that point no other one modifies the list so IFADDR_READER_FOREACH
is unnecessary. Use of IFADDR_READER_FOREACH is harmless in general though,
if we try to detect contract violations of pserialize, using it violates
the contract. So avoid using it makes life easy.
Ensure to call if_addr_init with holding if_ioctl_lock
Get rid of outdated comments
Fix build of kernels without ether
By throwing out if_enable_vlan_mtu and if_disable_vlan_mtu that
created a unnecessary dependency from if.c to if_ethersubr.c.
PR kern/52790
Rename IFNET_LOCK to IFNET_GLOBAL_LOCK
IFNET_LOCK will be used in another lock, if_ioctl_lock (might be renamed then).
Wrap if_ioctl_lock with IFNET_* macros (NFC)
Also if_ioctl_lock perhaps needs to be renamed to something because it's now
not just for ioctl...
Reorder some destruction routines in if_detach
- Destroy if_ioctl_lock at the end of the if_detach because it's used in various
  destruction routines
- Move psref_target_destroy after pr_purgeif because we want to use psref in
  pr_purgeif (otherwise destruction procedures can be tricky)
Ensure to call if_mcast_op with holding IFNET_LOCK
Note that CARP doesn't deal with IFNET_LOCK yet.
Remove IFNET_GLOBAL_LOCK where it's unnecessary because IFNET_LOCK is held
Describe which lock is used to protect each member variable of struct ifnet
Requested by skrll@
Write a guideline for converting an interface to IFEF_MPSAFE
Requested by skrll@
Note that IFNET_LOCK must not be held in softint
Don't set IFEF_MPSAFE unless NET_MPSAFE at this point
Because recent investigations show that interfaces with IFEF_MPSAFE need to
follow additional restrictions to work with the flag safely. We should enable it
on an interface by default only if the interface surely satisfies the
restrictions, which are described in if.h.
Note that enabling IFEF_MPSAFE solely gains a few benefit on performance because
the network stack is still serialized by the big kernel locks by default.

Revision 1.30.22.1 / (download) - annotate - [select for diffs], Sun Dec 3 11:39:02 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.30: +32 -19 lines
Diff to previous 1.30 (colored) next main 1.31 (colored)

update from HEAD

Revision 1.32.6.1 / (download) - annotate - [select for diffs], Wed Nov 22 14:36:55 2017 UTC (6 years, 4 months ago) by martin
Branch: netbsd-8
Changes since 1.32: +13 -18 lines
Diff to previous 1.32 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #370):
	sys/net/if_media.c: revision 1.33
	sys/net/if_media.c: revision 1.34
No functional change:
  - Simplify ifmedia_removeall using with ifmedia_delete_instance(IFM_INST_ANY).
  - KNF.
  Clear ifm_cur and ifm_media after removing all ifmedia entries(IFM_INST_ANY)
in ifmedia_delete_instance() like if_media.c rev. 1.32.
Now if_media_delete_instance(IFM_INST_ANY) is the same as ifmedia_removeall().

Revision 1.35 / (download) - annotate - [select for diffs], Wed Nov 22 03:03:18 2017 UTC (6 years, 4 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, pgoyette-compat-base, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.34: +20 -4 lines
Diff to previous 1.34 (colored)

Hold KERNEL_LOCK on if_ioctl selectively based on IFEF_MPSAFE

If IFEF_MPSAFE is set, hold the lock and otherwise don't hold.

This change requires additions of KERNEL_LOCK to subsequence functions from
if_ioctl such as ifmedia_ioctl and ifioctl_common to protect non-MP-safe
components.

Proposed on tech-kern@ and tech-net@

Revision 1.34 / (download) - annotate - [select for diffs], Mon Oct 23 03:54:40 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.33: +6 -4 lines
Diff to previous 1.33 (colored)

 Clear ifm_cur and ifm_media after removing all ifmedia entries(IFM_INST_ANY)
in ifmedia_delete_instance() like if_media.c rev. 1.32.
Now if_media_delete_instance(IFM_INST_ANY) is the same as ifmedia_removeall().

Revision 1.33 / (download) - annotate - [select for diffs], Fri Oct 20 08:04:39 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.32: +9 -16 lines
Diff to previous 1.32 (colored)

No functional change:
 - Simplify ifmedia_removeall using with ifmedia_delete_instance(IFM_INST_ANY).
 - KNF.

Revision 1.30.48.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:05 2017 UTC (6 years, 11 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.30: +5 -3 lines
Diff to previous 1.30 (colored) next main 1.31 (colored)

Sync with HEAD

Revision 1.30.44.1 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:50 2017 UTC (7 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.30: +5 -3 lines
Diff to previous 1.30 (colored) next main 1.31 (colored)

Sync with HEAD

Revision 1.30.40.1 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:58 2017 UTC (7 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.30: +5 -3 lines
Diff to previous 1.30 (colored) next main 1.31 (colored)

Sync with HEAD

Revision 1.32 / (download) - annotate - [select for diffs], Wed Jan 25 07:19:24 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.31: +4 -2 lines
Diff to previous 1.31 (colored)

ifmedia_removeall(): Clear ifm_cur and ifm_media after removing all ifmedia
entries.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Jan 25 07:17:19 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

ifmedia_init(): Clear ifm_media with IFM_NONE instead of 0.

Revision 1.27.10.3 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:27 2010 UTC (14 years, 1 month ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.27.10.2: +3 -3 lines
Diff to previous 1.27.10.2 (colored) to branchpoint 1.27 (colored) next main 1.28 (colored)

sync with head

Revision 1.30 / (download) - annotate - [select for diffs], Mon Oct 5 21:27:36 2009 UTC (14 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, yamt-nfs-mp-base9, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-uvmplock-nbase, rmind-uvmplock-base, rmind-uvmplock, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, pgoyette-localcount-base, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, localcount-20160914, khorben-n900, jym-xensuspend-nbase, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-socketcan-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver
Branch point for: tls-maxphys, pgoyette-localcount, nick-nhusb, bouyer-socketcan
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

Replace u_quad_t with uint64_t.  u_quad_t is just a typedef for
uint64_t, so no ABI/API breakage will result from this change.

Revision 1.27.10.2 / (download) - annotate - [select for diffs], Mon May 4 08:14:15 2009 UTC (14 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.27.10.1: +15 -2 lines
Diff to previous 1.27.10.1 (colored) to branchpoint 1.27 (colored)

sync with head.

Revision 1.27.6.2 / (download) - annotate - [select for diffs], Sun Jun 29 09:33:18 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.27.6.1: +13 -0 lines
Diff to previous 1.27.6.1 (colored) to branchpoint 1.27 (colored) next main 1.28 (colored)

Sync with HEAD.

Revision 1.28.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:58 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.28: +15 -2 lines
Diff to previous 1.28 (colored) next main 1.29 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.28.4.1 / (download) - annotate - [select for diffs], Wed Jun 18 16:33:50 2008 UTC (15 years, 10 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.28: +15 -2 lines
Diff to previous 1.28 (colored) next main 1.29 (colored)

Sync with head.

Revision 1.27.8.2 / (download) - annotate - [select for diffs], Tue Jun 17 09:15:13 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.27.8.1: +15 -2 lines
Diff to previous 1.27.8.1 (colored) to branchpoint 1.27 (colored) next main 1.28 (colored)

sync with head.

Revision 1.29 / (download) - annotate - [select for diffs], Sun Jun 15 16:33:58 2008 UTC (15 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, nick-hppapmap, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, jymxensuspend-base, jym-xensuspend-base, jym-xensuspend, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, ad-audiomp2-base, ad-audiomp2
Changes since 1.28: +15 -2 lines
Diff to previous 1.28 (colored)

- Add more definitions from FreeBSD
- Add ifmedia_removeall from FreeBSD

Revision 1.27.6.1 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:22 2008 UTC (15 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.27: +2 -9 lines
Diff to previous 1.27 (colored)

Sync with HEAD.

Revision 1.27.8.1 / (download) - annotate - [select for diffs], Sun May 18 12:35:27 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-pf42
Changes since 1.27: +2 -9 lines
Diff to previous 1.27 (colored)

sync with head.

Revision 1.27.10.1 / (download) - annotate - [select for diffs], Fri May 16 02:25:40 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.27: +2 -9 lines
Diff to previous 1.27 (colored)

sync with head.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:09 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa, simonb-wapbl
Changes since 1.27: +2 -9 lines
Diff to previous 1.27 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.26.8.1 / (download) - annotate - [select for diffs], Sun Mar 23 02:05:05 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.26: +10 -3 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

sync with HEAD

Revision 1.26.14.1 / (download) - annotate - [select for diffs], Mon Feb 18 21:07:01 2008 UTC (16 years, 2 months ago) by mjf
Branch: mjf-devfs
Changes since 1.26: +10 -3 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Sync with HEAD.

Revision 1.24.4.2 / (download) - annotate - [select for diffs], Mon Jan 21 09:47:04 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.24.4.1: +10 -3 lines
Diff to previous 1.24.4.1 (colored) to branchpoint 1.24 (colored) next main 1.25 (colored)

sync with head

Revision 1.26.20.1 / (download) - annotate - [select for diffs], Thu Jan 10 23:44:34 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.26: +10 -3 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Sync with HEAD

Revision 1.27 / (download) - annotate - [select for diffs], Thu Jan 10 08:00:22 2008 UTC (16 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp, mjf-devfs2
Changes since 1.26: +10 -3 lines
Diff to previous 1.26 (colored)

Add a helper subroutine for ethernet drivers, ifmedia_change().

Revision 1.24.4.1 / (download) - annotate - [select for diffs], Mon Sep 3 14:42:09 2007 UTC (16 years, 7 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.24: +10 -2 lines
Diff to previous 1.24 (colored)

sync with head.

Revision 1.25.32.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:10:57 2007 UTC (16 years, 9 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.25: +10 -2 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

Sync with head.

Revision 1.25.30.1 / (download) - annotate - [select for diffs], Sat Jun 9 23:58:11 2007 UTC (16 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.25: +10 -2 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

Sync with head.

Revision 1.26 / (download) - annotate - [select for diffs], Tue May 29 21:32:30 2007 UTC (16 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, vmlocking-base, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, jmcneill-pm-base, jmcneill-pm, jmcneill-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: mjf-devfs, matt-armv6, bouyer-xeni386
Changes since 1.25: +10 -2 lines
Diff to previous 1.25 (colored)

Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:51 2005 UTC (18 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-uio_vmspace, yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, yamt-splraiseipl-base2, yamt-splraiseipl-base, yamt-splraiseipl, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, yamt-pdpolicy, yamt-idlelwp-base8, yamt-idlelwp, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, thorpej-atomic-base, thorpej-atomic, simonb-timecounters-base, simonb-timecounters, simonb-timcounters-final, rpaulo-netinet-merge-pcb-base, rpaulo-netinet-merge-pcb, reinoud-bufcleanup, post-newlock2-merge, peter-altq-base, peter-altq, newlock2-nbase, newlock2-base, newlock2, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm, gdamore-uart-base, gdamore-uart, elad-kernelauth-base, elad-kernelauth, chap-midi-nbase, chap-midi-base, chap-midi, ad-audiomp-base, ad-audiomp, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

merge ktrace-lwp.

Revision 1.23.2.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:29:31 2005 UTC (18 years, 11 months ago) by kent
Branch: kent-audio2
Changes since 1.23: +6 -6 lines
Diff to previous 1.23 (colored) next main 1.24 (colored)

sync with -current

Revision 1.23.4.1 / (download) - annotate - [select for diffs], Sat Mar 19 08:36:31 2005 UTC (19 years, 1 month ago) by yamt
Branch: yamt-km
Changes since 1.23: +6 -6 lines
Diff to previous 1.23 (colored) next main 1.24 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.18.6.5 / (download) - annotate - [select for diffs], Fri Mar 4 16:52:58 2005 UTC (19 years, 1 month ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.6.4: +6 -6 lines
Diff to previous 1.18.6.4 (colored) to branchpoint 1.18 (colored) next main 1.19 (colored)

Sync with HEAD.

Hi Perry!

Revision 1.24 / (download) - annotate - [select for diffs], Sat Feb 26 22:45:09 2005 UTC (19 years, 1 month ago) by perry
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, yamt-km-base4, yamt-km-base3, thorpej-vnode-attr-base, thorpej-vnode-attr, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, ktrace-lwp-base, kent-audio2-base
Branch point for: yamt-lazymbuf
Changes since 1.23: +6 -6 lines
Diff to previous 1.23 (colored)

nuke trailing whitespace

Revision 1.21.4.1 / (download) - annotate - [select for diffs], Fri Jan 7 15:27:00 2005 UTC (19 years, 3 months ago) by jdc
Branch: netbsd-2
CVS Tags: netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1
Changes since 1.21: +6 -4 lines
Diff to previous 1.21 (colored) next main 1.22 (colored)

Pull up revision 1.23 (requested by dyoung in ticket #1030).

As pointed out by Greg Troxel, ifmedia_entrys were allocated with
malloc_type M_IFADDR and freed with malloc_type M_DEVBUF.  This
causes a panic(9) in DIAGNOSTIC kernels.  Add malloc_type M_IFMEDIA
and use it for both malloc'ing and free'ing ifmedia_entrys.

Revision 1.21.2.1 / (download) - annotate - [select for diffs], Fri Jan 7 15:26:53 2005 UTC (19 years, 3 months ago) by jdc
Branch: netbsd-2-0
CVS Tags: netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE
Changes since 1.21: +6 -4 lines
Diff to previous 1.21 (colored) next main 1.22 (colored)

Pull up revision 1.23 (requested by dyoung in ticket #1030).

As pointed out by Greg Troxel, ifmedia_entrys were allocated with
malloc_type M_IFADDR and freed with malloc_type M_DEVBUF.  This
causes a panic(9) in DIAGNOSTIC kernels.  Add malloc_type M_IFMEDIA
and use it for both malloc'ing and free'ing ifmedia_entrys.

Revision 1.18.6.4 / (download) - annotate - [select for diffs], Sat Dec 18 09:32:50 2004 UTC (19 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.6.3: +6 -4 lines
Diff to previous 1.18.6.3 (colored) to branchpoint 1.18 (colored)

Sync with HEAD.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Dec 8 20:37:43 2004 UTC (19 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge
Branch point for: yamt-km, kent-audio2
Changes since 1.22: +6 -4 lines
Diff to previous 1.22 (colored)

As pointed out by Greg Troxel, ifmedia_entrys were allocated with
malloc_type M_IFADDR and freed with malloc_type M_DEVBUF.  This
causes a panic(9) in DIAGNOSTIC kernels.  Add malloc_type M_IFMEDIA
and use it for both malloc'ing and free'ing ifmedia_entrys.

Revision 1.18.6.3 / (download) - annotate - [select for diffs], Tue Sep 21 13:36:38 2004 UTC (19 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.6.2: +2 -2 lines
Diff to previous 1.18.6.2 (colored) to branchpoint 1.18 (colored)

Fix the sync with head I botched.

Revision 1.18.6.2 / (download) - annotate - [select for diffs], Sat Sep 18 14:54:16 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.6.1: +0 -0 lines
Diff to previous 1.18.6.1 (colored) to branchpoint 1.18 (colored)

Sync with HEAD.

Revision 1.18.6.1 / (download) - annotate - [select for diffs], Tue Aug 3 10:54:15 2004 UTC (19 years, 8 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18: +62 -79 lines
Diff to previous 1.18 (colored)

Sync with HEAD

Revision 1.22 / (download) - annotate - [select for diffs], Fri Apr 9 20:44:57 2004 UTC (20 years ago) by thorpej
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.21: +15 -36 lines
Diff to previous 1.21 (colored)

De-__P'ify.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Feb 19 11:58:30 2004 UTC (20 years, 2 months ago) by ragge
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1
Branch point for: netbsd-2-0, netbsd-2
Changes since 1.20: +4 -5 lines
Diff to previous 1.20 (colored)

Add media type 10GbaseLR. Change ifmb_baudrate and ifmedia_baudrate()
to u_quad_t instead of int (common speed today exceeds 2Gbit).

Revision 1.20 / (download) - annotate - [select for diffs], Mon Nov 3 14:43:32 2003 UTC (20 years, 5 months ago) by briggs
Branch: MAIN
Changes since 1.19: +25 -4 lines
Diff to previous 1.19 (colored)

ifmedia_set() should not panic, nor can it really fail.  So if there is
some problem setting the media to the requested value (usually IFM_AUTO),
we now force the media selection to IFM_NONE.
This addresses PR/14029 ``panic("ifmedia_set") a little too brutal''
and may address to some degree PR/19504 and PR/23341.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jul 25 19:35:57 2003 UTC (20 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.18: +24 -40 lines
Diff to previous 1.18 (colored)

Avoid DOS attack by setting ifm->ifm_media to a high number and running the
kernel out of memory. Thanks to Andreas Oman.

Revision 1.13.2.5 / (download) - annotate - [select for diffs], Wed Dec 11 06:46:32 2002 UTC (21 years, 4 months ago) by thorpej
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.13.2.4: +5 -3 lines
Diff to previous 1.13.2.4 (colored) to branchpoint 1.13 (colored) next main 1.14 (colored)

Sync with HEAD.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Nov 12 16:54:45 2002 UTC (21 years, 5 months ago) by chs
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Branch point for: ktrace-lwp
Changes since 1.17: +7 -5 lines
Diff to previous 1.17 (colored)

when there are multiple matches for the requested media, select the first
matching instance rather than the last one.  this restores the behaviour
in the multiple-match case to what it was when all the drivers only allowed
instance 0 (and in particular, makes autonegotiation of the on-board fxp
on my DK440LX board work again by default, which has two PHYs that both
advertise "auto").  as discussed on tech-net.

Revision 1.13.2.4 / (download) - annotate - [select for diffs], Mon Nov 11 22:15:00 2002 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.13.2.3: +5 -5 lines
Diff to previous 1.13.2.3 (colored) to branchpoint 1.13 (colored)

Catch up to -current

Revision 1.17 / (download) - annotate - [select for diffs], Thu Nov 7 08:00:47 2002 UTC (21 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.16: +7 -7 lines
Diff to previous 1.16 (colored)

Fix more signed/unsigned comparison warnings.

Revision 1.14.2.2 / (download) - annotate - [select for diffs], Thu Oct 10 18:43:44 2002 UTC (21 years, 6 months ago) by jdolecek
Branch: kqueue
Changes since 1.14.2.1: +3 -3 lines
Diff to previous 1.14.2.1 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored)

sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.13.2.3 / (download) - annotate - [select for diffs], Tue Sep 17 21:22:50 2002 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.13.2.2: +2 -2 lines
Diff to previous 1.13.2.2 (colored) to branchpoint 1.13 (colored)

Catch up to -current.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Sep 11 05:36:27 2002 UTC (21 years, 7 months ago) by itojun
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

KNF - return is not a function.

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Thu Jan 10 20:02:08 2002 UTC (22 years, 3 months ago) by thorpej
Branch: kqueue
Changes since 1.14: +4 -1 lines
Diff to previous 1.14 (colored)

Sync kqueue branch with -current.

Revision 1.13.2.2 / (download) - annotate - [select for diffs], Wed Nov 14 19:17:23 2001 UTC (22 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.13.2.1: +4 -1 lines
Diff to previous 1.13.2.1 (colored) to branchpoint 1.13 (colored)

Catch up to -current.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Nov 12 23:49:40 2001 UTC (22 years, 5 months ago) by lukem
Branch: MAIN
CVS Tags: newlock-base, newlock, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, ifpoll-base, gehenna-devsw-base, gehenna-devsw, eeh-devprop-base, eeh-devprop
Changes since 1.14: +4 -1 lines
Diff to previous 1.14 (colored)

add RCSIDs

Revision 1.13.2.1 / (download) - annotate - [select for diffs], Thu Jun 21 20:08:07 2001 UTC (22 years, 10 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Catch up to -current.

Revision 1.14 / (download) - annotate - [select for diffs], Fri May 18 08:56:27 2001 UTC (22 years, 11 months ago) by drochner
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: kqueue
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

fix typo in comment

Revision 1.5.2.3 / (download) - annotate - [select for diffs], Mon Mar 12 13:31:48 2001 UTC (23 years, 1 month ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.5.2.2: +2 -2 lines
Diff to previous 1.5.2.2 (colored) to branchpoint 1.5 (colored) next main 1.6 (colored)

Sync with HEAD.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Feb 26 09:42:00 2001 UTC (23 years, 1 month ago) by joda
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

when changing to an unsupported media type, return EINVAL instead of
ENXIO

Revision 1.5.2.2 / (download) - annotate - [select for diffs], Sun Feb 11 19:17:09 2001 UTC (23 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.5.2.1: +6 -6 lines
Diff to previous 1.5.2.1 (colored) to branchpoint 1.5 (colored)

Sync with HEAD.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jan 17 19:04:03 2001 UTC (23 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.11: +6 -6 lines
Diff to previous 1.11 (colored)

make local const stuff as static const, so that it's pushed to text segment

Revision 1.5.2.1 / (download) - annotate - [select for diffs], Mon Nov 20 18:10:04 2000 UTC (23 years, 5 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.5: +54 -14 lines
Diff to previous 1.5 (colored)

Update thorpej_scsipi to -current as of a month ago

Revision 1.3.6.1 / (download) - annotate - [select for diffs], Thu May 11 09:25:19 2000 UTC (23 years, 11 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003
Changes since 1.3: +24 -1 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

Pull up revision 1.9 (requested by jhawk):
  Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Mar 30 09:45:36 2000 UTC (24 years ago) by augustss
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, minoura-xpg4dl-base, minoura-xpg4dl
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Kill some more register declarations.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Mar 13 23:52:39 2000 UTC (24 years, 1 month ago) by soren
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Fix doubled 'the's in comments.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Mar 6 20:50:29 2000 UTC (24 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.8: +24 -1 lines
Diff to previous 1.8 (colored)

Add ifmedia_baudrate(), which returns a value suitable for ifi_baudrate
given a media word, or 0 for unknown.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jan 26 21:58:17 2000 UTC (24 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.7: +22 -1 lines
Diff to previous 1.7 (colored)

Add a way to delete all media for a specified instance.

Revision 1.5.6.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:36:10 1999 UTC (24 years, 3 months ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.5: +8 -12 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

Pull up to last week's -current.

Revision 1.5.4.1 / (download) - annotate - [select for diffs], Mon Nov 15 00:42:12 1999 UTC (24 years, 5 months ago) by fvdl
Branch: fvdl-softdep
Changes since 1.5: +8 -12 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

Sync with -current

Revision 1.7 / (download) - annotate - [select for diffs], Wed Nov 3 23:06:35 1999 UTC (24 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, fvdl-softdep-base
Changes since 1.6: +8 -8 lines
Diff to previous 1.6 (colored)

Make the ifmedia_entry list a TAILQ.  This is pretty much for cosmetics
(media added to tail, so that when e.g. the list is run to print out
what media exist, they appear in-order).

Revision 1.6 / (download) - annotate - [select for diffs], Wed Oct 27 17:59:24 1999 UTC (24 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: comdex-fall-1999-base, comdex-fall-1999
Changes since 1.5: +1 -5 lines
Diff to previous 1.5 (colored)

Expose the ifmedia_match() function.

Revision 1.3.8.1 / (download) - annotate - [select for diffs], Mon Jun 21 01:27:34 1999 UTC (24 years, 10 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.3: +1 -1 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

Sync w/ -current.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Apr 30 17:47:36 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-base
Branch point for: wrstuden-devbsize, thorpej_scsipi, fvdl-softdep
Changes since 1.4: +1 -2 lines
Diff to previous 1.4 (colored)

Back out previous.  It was just ... braindamaged.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Apr 30 17:30:49 1999 UTC (24 years, 11 months ago) by abs
Branch: MAIN
Changes since 1.3: +3 -2 lines
Diff to previous 1.3 (colored)

If the driver only supports one media type, and ifmedia_ioctl() is called to
select the current medium, (and it is not autoselect), assume no change and
do not try to select the medium. Fixes 'ifconfig le0 medium 10base5' on sparc2
without requiring a 'do nothing' mediachange callback.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Aug 30 07:39:39 1998 UTC (25 years, 7 months ago) by enami
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, kenh-if-detach-base, kenh-if-detach, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame, chs-ubc-base, chs-ubc
Branch point for: netbsd-1-4, chs-ubc2
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

Make this compile with -DIFMEDIA_DEBUG.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Aug 6 02:19:34 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.1: +70 -90 lines
Diff to previous 1.1 (colored)

Completely rewrite the way media descriptions are represented.  The same
data structure is used, but a much saner matching mechanism is used, one
which allows greater ease in adding new types.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Mar 17 02:55:15 1997 UTC (27 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal, netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, marc-pcmcia-bp, marc-pcmcia-base, marc-pcmcia, eeh-paddr_t-base, eeh-paddr_t, bouyer-scsipi

BSD/OS-style network interface media selection, implemented by
Jonathan Stone and myself.  Many thanks to Matt Thomas for providing
the information necessary to implement this interface, and for helping
to shake out the bugs.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>