The NetBSD Project

CVS log for src/sys/dev/usb/if_ure.c

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.58.4.1 / (download) - annotate - [select for diffs], Sat Oct 14 06:58:19 2023 UTC (5 months, 2 weeks ago) by martin
Branch: netbsd-10
CVS Tags: 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
Changes since 1.58: +3 -2 lines
Diff to previous 1.58 (colored) next main 1.59 (colored) to selected 1.21 (colored)

Pull up following revision(s) (requested by riastradh in ticket #413):

	sys/dev/usb/if_ure.c: revision 1.59

ure(4): Set all bits, not no bits, in multicast filter for promisc.
This was lost in revision 1.40.
PR kern/57648

Revision 1.59 / (download) - annotate - [select for diffs], Mon Oct 9 11:28:05 2023 UTC (5 months, 2 weeks ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.58: +3 -2 lines
Diff to previous 1.58 (colored) to selected 1.21 (colored)

ure(4): Set all bits, not no bits, in multicast filter for promisc.

This was lost in revision 1.40.

PR kern/57648

XXX pullup-10

Revision 1.14.2.3 / (download) - annotate - [select for diffs], Sun Sep 18 13:32:27 2022 UTC (18 months, 1 week ago) by martin
Branch: netbsd-9
Changes since 1.14.2.2: +3 -3 lines
Diff to previous 1.14.2.2 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored) to selected 1.21 (colored)

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

	sys/dev/usb/if_ure.c: revision 1.58 (via patch)

Use unsigned to avoid undefined behavior in ure_uno_mcast(). Found by kUBSan.

Revision 1.58 / (download) - annotate - [select for diffs], Fri Sep 16 07:34:36 2022 UTC (18 months, 1 week ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-10-base, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Changes since 1.57: +3 -3 lines
Diff to previous 1.57 (colored) to selected 1.21 (colored)

Use unsigned to avoid undefined behavior in ure_uno_mcast(). Found by kUBSan.

Revision 1.57 / (download) - annotate - [select for diffs], Sat Aug 20 14:08:59 2022 UTC (19 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored) to selected 1.21 (colored)

usbnet(9): New usbnet_ispromisc(un).

Replaces ifp->if_flags & IFF_PROMISC in multicast filter updates.

Revision 1.56 / (download) - annotate - [select for diffs], Thu Mar 3 05:56:28 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored) to selected 1.21 (colored)

usbnet: Omit needless detachcv name parameter to usbnet_attach.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Mar 3 05:56:09 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.54: +3 -3 lines
Diff to previous 1.54 (colored) to selected 1.21 (colored)

usbnet: Factor usbnet_init_rx_tx out into usbnet_if_init.

Make it private; no need for drivers to call it any more.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Mar 3 05:55:19 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.53: +2 -6 lines
Diff to previous 1.53 (colored) to selected 1.21 (colored)

usbnet drivers: Prune dead IFF_RUNNING branches in *_uno_init.

usbnet(9) guarantees !IFF_RUNNING now before calling it.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Mar 3 05:55:01 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.52: +2 -5 lines
Diff to previous 1.52 (colored) to selected 1.21 (colored)

usbnet drivers: Omit needless isdying tests in *_uno_init.

usbnet(9) already checks this immediately before calling *_uno_init.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Mar 3 05:54:37 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.51: +2 -8 lines
Diff to previous 1.51 (colored) to selected 1.21 (colored)

usbnet drivers: Omit needless usbnet core lock and assertions.

During attach, the caller has exclusive access to the usbnet until
usbnet_attach_ifp.  At other times, register access is serialized
either by the usbnet multicast lock or by IFNET_LOCK.

Revision 1.51 / (download) - annotate - [select for diffs], Thu Mar 3 05:54:21 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.50: +7 -3 lines
Diff to previous 1.50 (colored) to selected 1.21 (colored)

usbnet drivers: Avoid undefined behaviour if read reg fails.

Some callers don't check the error code, e.g. ~all the mii phy
drivers using PHY_READ.  Just return zero if the device is gone or
the xfer fails for any other reason.

Revision 1.50 / (download) - annotate - [select for diffs], Thu Mar 3 05:53:33 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.49: +2 -5 lines
Diff to previous 1.49 (colored) to selected 1.21 (colored)

usbnet drivers: Omit redundant multicast filter update on init.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Mar 3 05:53:23 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.48: +2 -4 lines
Diff to previous 1.48 (colored) to selected 1.21 (colored)

usbnet: Apply hardware multicast filter updates synchronously again.

To make this work:

1. Do it only under a new lock, unp_mcastlock.  This lock lives at
   IPL_SOFTCLOCK so it can be taken from network stack callouts.  It
   is forbidden to acquire the usbnet core lock under unp_mcastlock.

2. Do it only after usbnet_init_rx_tx and before usbnet_stop; if
   issued at any other time, drop the update on the floor.

3. Make usbnet_init_rx_tx apply any pending multicast filter updates
   under the lock before setting the flag that allows SIOCADDMULTI or
   SIOCDELMULTI to apply the updates.

4. Remove core lock asserts from various drivers' register access
   routines.  This is necessary because the multicast filter updates
   are done with register reads/writes, but _cannot_ take the core
   lock when the caller holds softnet_lock.

This now programs the hardware multicast filter redundantly in many
drivers which already explicitly call *_uno_mcast from the *_uno_init
routines.  This is probably harmless, but it will likely be better to
remove the explicit calls.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 3 05:53:04 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.47: +5 -13 lines
Diff to previous 1.47 (colored) to selected 1.21 (colored)

usbnet drivers: Omit needless uno_mcast locked subroutines.

uno_mcast is now called with the core lock already held so there is
no need for a separate locked subroutine.

Revision 1.47 / (download) - annotate - [select for diffs], Thu Mar 3 05:52:46 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.46: +2 -6 lines
Diff to previous 1.46 (colored) to selected 1.21 (colored)

usbnet: Take the core lock around uno_mcast.

Every driver does this already.  This will enable us to change the
lock that serializes access to the registers so we can go back to
doing this synchronously in SIOCADDMULTI/SIOCDELMULTI.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Mar 3 05:52:35 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.45: +3 -11 lines
Diff to previous 1.45 (colored) to selected 1.21 (colored)

usbnet drivers: Omit needless uno_init locked subroutines.

uno_init is now called with the core lock already held so there is no
need for a separate locked subroutine.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Mar 3 05:51:27 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.44: +2 -4 lines
Diff to previous 1.44 (colored) to selected 1.21 (colored)

usbnet drivers: No need for usbnet_busy in uno_mcast.

This callback always runs with IFNET_LOCK held, and during a task
that usbnet_detach prevents scheduling anew and waits for finishing
before completing the detach, so there is no need to hang onto a
reference count here.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Mar 3 05:51:17 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.43: +2 -6 lines
Diff to previous 1.43 (colored) to selected 1.21 (colored)

usbnet drivers: No need for usbnet_busy in uno_init.

This callback always runs with the IFNET_LOCK held, and the interface
cannot be detached until the IFNET_LOCK is released, so there is no
need to hang onto a reference count here.  (None of the usbnet
drivers touch the IFNET_LOCK except to verify it is held sometimes.)

Revision 1.43 / (download) - annotate - [select for diffs], Thu Mar 3 05:51:06 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.42: +7 -16 lines
Diff to previous 1.42 (colored) to selected 1.21 (colored)

usbnet: Split multicast filter reprogramming into separate operation.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Mar 3 05:50:57 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.41: +12 -2 lines
Diff to previous 1.41 (colored) to selected 1.21 (colored)

usbnet drivers: Stop timeout loops early if device is detaching.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Mar 3 05:50:22 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.40: +2 -4 lines
Diff to previous 1.40 (colored) to selected 1.21 (colored)

usbnet: Enter uno_init with the core lock held.

This reduces code in all drivers except urndis(4) and aue(4).

However, it's still safe for urndis to drop the core lock because the
ifnet is locked, and the ifnet lock covers the DOWN->UP (uno_init)
and UP->DOWN (uno_stop) transitions.

Revision 1.8.2.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:04:49 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.8.2.2: +422 -939 lines
Diff to previous 1.8.2.2 (colored) to branchpoint 1.8 (colored) next main 1.9 (colored) to selected 1.21 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.40 / (download) - annotate - [select for diffs], Fri Mar 27 18:04:45 2020 UTC (4 years ago) by nisimura
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, 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.39: +45 -56 lines
Diff to previous 1.39 (colored) to selected 1.21 (colored)


- change to use rcvfilt_locked() name to clarify the intent.
- stylise receive filter manipulation logic.
- use ETHER_F_ALLMULTI flag.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Mar 21 06:54:43 2020 UTC (4 years ago) by skrll
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored) to selected 1.21 (colored)

KNF

Revision 1.38 / (download) - annotate - [select for diffs], Sun Mar 15 23:04:51 2020 UTC (4 years ago) by thorpej
Branch: MAIN
Changes since 1.37: +44 -50 lines
Diff to previous 1.37 (colored) to selected 1.21 (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.37 / (download) - annotate - [select for diffs], Fri Mar 13 19:17:27 2020 UTC (4 years ago) by martin
Branch: MAIN
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored) to selected 1.21 (colored)

Fix printf format

Revision 1.36 / (download) - annotate - [select for diffs], Fri Mar 13 18:17:40 2020 UTC (4 years ago) by christos
Branch: MAIN
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored) to selected 1.21 (colored)

PR/55068: sc.dying: Fix printf formats:
- no %s/%p for kernel log
- 0x% -> %#
- always %j for kernel log

Revision 1.34.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:19:16 2020 UTC (4 years ago) by ad
Branch: ad-namecache
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored) next main 1.35 (colored) to selected 1.21 (colored)

Sync with head.

Revision 1.35 / (download) - annotate - [select for diffs], Wed Jan 29 06:39:07 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored) to selected 1.21 (colored)

Adopt <net/if_stats.h>.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Jan 7 06:42:26 2020 UTC (4 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored) to selected 1.21 (colored)

Localify, constify.

Revision 1.14.2.2 / (download) - annotate - [select for diffs], Thu Oct 17 18:53:25 2019 UTC (4 years, 5 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.14.2.1: +19 -3 lines
Diff to previous 1.14.2.1 (colored) to branchpoint 1.14 (colored) to selected 1.21 (colored)

Pull up following revision(s) (requested by bad in ticket #343):

	sys/dev/usb/if_ure.c: revision 1.32
	sys/dev/usb/if_ure.c: revision 1.33

read mac address of ure version 4c10 from URE_PLA_IDR, save as 4c00.
from ganbold@freebsd r346052.
XXX pullup-9

 -

allocate a random mac address if on-chip mac is all zeroes.
helps ure(4) on NanoPi R1.
partly from ganbold@freebsd r346052.
XXX pullup-9

Revision 1.33 / (download) - annotate - [select for diffs], Wed Oct 16 13:11:16 2019 UTC (4 years, 5 months ago) by bad
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.32: +17 -2 lines
Diff to previous 1.32 (colored) to selected 1.21 (colored)

allocate a random mac address if on-chip mac is all zeroes.

helps ure(4) on NanoPi R1.

partly from ganbold@freebsd r346052.

XXX pullup-9

Revision 1.32 / (download) - annotate - [select for diffs], Wed Oct 16 13:02:51 2019 UTC (4 years, 5 months ago) by bad
Branch: MAIN
Changes since 1.31: +4 -3 lines
Diff to previous 1.31 (colored) to selected 1.21 (colored)

read mac address of ure version 4c10 from URE_PLA_IDR, save as 4c00.

from ganbold@freebsd r346052.

XXX pullup-9

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Sun Sep 1 13:00:36 2019 UTC (4 years, 6 months ago) by martin
Branch: netbsd-9
Changes since 1.14: +355 -1005 lines
Diff to previous 1.14 (colored) to selected 1.21 (colored)

Pull up following revision(s) (requested by mrg in ticket #135):

	distrib/sets/lists/comp/mi			1.2279
	distrib/sets/lists/modules/mi			1.123
	share/man/man9/Makefile				1.438
	share/man/man9/usbnet.9				1.1-1.9
	sys/dev/ic/rndisreg.h				1.3
	sys/dev/usb/TODO				1.47-1.52
	sys/dev/usb/TODO.usbmp				1.15,1.16
	sys/dev/usb/files.usb				1.157-1.167
	sys/dev/usb/if_aue.c				1.155-1.161
	sys/dev/usb/if_auereg.h				1.30-1.32
	sys/dev/usb/if_axe.c				1.103-1.119
	sys/dev/usb/if_axen.c				1.51-1.53,1.55-1.67
	sys/dev/usb/if_axenreg.h			1.15
	sys/dev/usb/if_cdce.c				1.54-1.67
	sys/dev/usb/if_cue.c				1.85,1.86
	sys/dev/usb/if_cuereg.h				1.23
	sys/dev/usb/if_kue.c				1.97-1.100
	sys/dev/usb/if_kuereg.h				1.23,1.24
	sys/dev/usb/if_mue.c				1.51-1.55
	sys/dev/usb/if_muereg.h				1.6
	sys/dev/usb/if_muevar.h				1.9
	sys/dev/usb/if_smsc.c				1.46-1.61
	sys/dev/usb/if_smscreg.h			1.6
	sys/dev/usb/if_smscvar.h			delete
	sys/dev/usb/if_udav.c				1.60-1.71
	sys/dev/usb/if_udavreg.h			1.14,1.15
	sys/dev/usb/if_upl.c				1.65,1.66
	sys/dev/usb/if_ure.c				1.15-1.31
	sys/dev/usb/if_urevar.h				1.4,1.5
	sys/dev/usb/if_url.c				1.67-1.70
	sys/dev/usb/if_urlreg.h				1.14
	sys/dev/usb/if_urndis.c				1.22-1.33
	sys/dev/usb/if_urtwn.c				1.72
	sys/dev/usb/ohci.c				1.290
	sys/dev/usb/uhub.c				1.143
	sys/dev/usb/usb.c				1.180
	sys/dev/usb/usb.h				1.118
	sys/dev/usb/usb_mem.c				1.71
	sys/dev/usb/usb_subr.c				1.238,1.239
	sys/dev/usb/usbdevs				1.772
	sys/dev/usb/usbdi.c				1.183,1.186
	sys/dev/usb/usbdi.h				1.97
	sys/dev/usb/usbdi_util.c			1.75
	sys/dev/usb/usbhist.h				1.5,1.6
	sys/dev/usb/usbnet.c				1.1-1.24
	sys/dev/usb/usbnet.h				1.1-1.14
	sys/dev/usb/usbroothub.c			1.9
	sys/dev/usb/xhci.c				1.109,1.110
	sys/modules/Makefile				1.223
	sys/modules/usbnet/Makefile			1.1

usbnet(9): Add common framework for USB network devices.
This bring various safety fixes to all updated drivers,
and includes locking clean up, detach safety when being
used or not, separate rx/tx locks to improve performance,
porting to NET_MPSAFE, many edge/error case bugs in
drivers fixed, as well as resovling PRs 54303 and 54308.
These drivers are converted: axe(4), axen(4), aue(4),
cdce(4), cue(4), kue(4), mue(4), smsc(4), udav(4),
upl(4), ure(4), url(4), and urndis(4).

Revision 1.31 / (download) - annotate - [select for diffs], Fri Aug 23 04:32:57 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored) to selected 1.21 (colored)

s/UBSNET_MII_DECL_DEFAULT/USBNET_MII_DECL_DEFAULT/.  from sc.dying.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Aug 20 06:37:06 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.29: +14 -12 lines
Diff to previous 1.29 (colored) to selected 1.21 (colored)

couple more changes to usbnet(9):

- MII read/write reg return int instead of usbd_status (requested by skrll)
- usbnet_attach_ifp(9) changes arg, two mii-specific flags are placed by a
  pointer to new struct usbnet_mii.  if not NULL, then attach an MII to this
  interface like previous have_mii parameter.  use this to allow ure(4) to
  properly pass PHY location to mii_attach().

welcome netbsd 9.99.10.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Aug 19 07:33:37 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.28: +12 -2 lines
Diff to previous 1.28 (colored) to selected 1.21 (colored)

move the check against un_phyno from usbnet back into the drivers
that do this (axe, axen, mue, smsc, ure.)  it made mii scanning
only work for phy 0, and aue needs it for at least one device.

fix smsc to return usbd_status not -1 on failure.  XXX smsc was
writing to '*val' even in error cases, it does not now.

remove a double call to IFQ_SET_READY() (noticed by chuq).

avoid unlock+instant relock by using usbnet_lock_mii_un_locked().

Revision 1.28 / (download) - annotate - [select for diffs], Fri Aug 16 08:29:20 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored) to selected 1.21 (colored)

make the default debug level zero.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Aug 15 05:52:23 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.26: +5 -8 lines
Diff to previous 1.26 (colored) to selected 1.21 (colored)

- usbnet_rx_loop_cb's usbd_xfer parameter is never used and available
  in the usbnet_chain if needed.  remove it
- usbnet media status change already set link to false, don't repeat
  this in every driver
- don't clear link in stop, nothing was re-enabling it for non-MII
- add optional uno_tick_cb(struct usbnet *un) that is called from the
  usbnet tick timer
- remove wrong debug sysctl prototype

rx_loop and timer are kernel versions changes, but hopefully this is
the last one for usbnet.  working with 3 more drivers now (cue, mue
and url), leaving only aue, kue, upl and umb undone (aue may work
with previously supported devices, mine doesn't work with our driver,
kue and upl have patches for testing and umb is undone.)

Revision 1.26 / (download) - annotate - [select for diffs], Wed Aug 14 03:44:58 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.25: +7 -5 lines
Diff to previous 1.25 (colored) to selected 1.21 (colored)

introduce usbnet_set_dying().  will be used by url(4) conversion.
bump version.

introduce USBNET_MODULE() that encompasses almost all the module
specific code for usbnet modules.  they still need to include
the relevant ioconf.c, but everything else is now just, eg,

	USBNET_MODULE(axen)

Revision 1.25 / (download) - annotate - [select for diffs], Sun Aug 11 23:55:43 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.24: +2 -5 lines
Diff to previous 1.24 (colored) to selected 1.21 (colored)

don't set dv_private.  it's a bad pattern and only didn't
trip kmem_free() lossage because struct usbnet is at the
start of the softc.

for now, enforce this as part of the ABI.

catch up urndis with tx_prepare checking buffer length,
and also add an assert to usbnet_start_locked() to match.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Aug 11 08:57:36 2019 UTC (4 years, 7 months ago) by skrll
Branch: MAIN
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored) to selected 1.21 (colored)

Appease module build

Revision 1.23 / (download) - annotate - [select for diffs], Sun Aug 11 02:37:04 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored) to selected 1.21 (colored)

copy a pattern from if_udav.c, which already had "too much" check.

even though overflow or underflow is really unlikely here, reorder
various expressions to reduce the likelyhood even further.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Aug 11 01:04:33 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.21: +5 -5 lines
Diff to previous 1.21 (colored)

in tx_prepare callback make sure to reject any mbuf that is larger
than can fit in the buffer.  done at the driver and not usbnet
layer because the driver knows how much beyond the mbuf data needs
to be sent (headers and trailers.)

axen(4) had a KASSERT() for this condition, but there's no
invariant here we can check so it's best as an error return.

XXX: only tested on these drivers, needs to be copied to udav, smsc
and urndis after testing as well as the not commited conversions.

Revision 1.21 / (download) - annotate - [selected], Sat Aug 10 02:17:36 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.20: +12 -8 lines
Diff to previous 1.20 (colored)

reduce the scope of struct usbnet:
- move a large number of members internal to usbnet.c's new
  "struct usbnet_private".
- provide accessors for a few of these
- move struct usbnet_cdata into usbnet.c as well, but move
  bufsz, list count, and xfer flags back out into struct usbnet,
  and have them set as part of the setup efore usbnet_attach()
- split the intr pipe parts into their own structure
- move all the main usbnet*lock* code into usbnet.c too

usbnet_attach() goes down to 2 args, and the inputs needed are
now the full contents of 'struct usbnet' besides the driver
owned 'un_flags' and usbnet owned 'un_pri'.

welcome netbsd 9.99.6.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Aug 9 02:52:59 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.19: +44 -49 lines
Diff to previous 1.19 (colored) to selected 1.21 (colored)

use new un_flags member of usbnet:
- axen(4) and cdce(4) are now able to use struct usbnet directly
  as softc, udav also done but untested

Revision 1.19 / (download) - annotate - [select for diffs], Fri Aug 9 01:17:33 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.18: +39 -29 lines
Diff to previous 1.18 (colored) to selected 1.21 (colored)

update usbnet some:
- move rx/tx xfer flags into usbnet_cdata
- move the callbacks into usbnet_ops structure
- move rx/tx xfer flags arguments from usbnet_init_rx_tx()
  and move them all into usbnet_attach() arguments
- s/miibus/mii/ in some places for consistency

other clean up:
- create wrapper functions for callbacks, move knowledge about
  special handling (OK to be missing, error eating) there.
- use cdata pointer if already available
- provide some more macros (will be real functions later) for
  accessing usbnet members, use existing ones more

bump kernel version.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Aug 6 01:42:22 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.17: +2 -5 lines
Diff to previous 1.17 (colored) to selected 1.21 (colored)

for ethernet usb network devices, print the mac addr in usbnet.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Aug 6 00:19:57 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored) to selected 1.21 (colored)

extend usbnet to cope with if_upl, if_smsc, and if_umb needs:

- usbnet_enqueue() can set mbuf flags and csum_data
- usbnet_input() for non-ethernet based devices (upl, umb)
- allow a complete override for ioctl()
- remove converted list -- we have compiling and/or working patches for
  all the devices except for umb(4), will be merged as testing happens

hopefully this is the last ABI change, though  it may end up being
extended for additional smsc(4)  support.


hello for real netbsd 9.99.3!

Revision 1.16 / (download) - annotate - [select for diffs], Sun Aug 4 18:04:18 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.15: +5 -4 lines
Diff to previous 1.15 (colored) to selected 1.21 (colored)

move / re-add some headers to fix INET6 builds.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Aug 4 09:03:46 2019 UTC (4 years, 7 months ago) by mrg
Branch: MAIN
Changes since 1.14: +299 -964 lines
Diff to previous 1.14 (colored) to selected 1.21 (colored)

convert axe(4) and ure(4) to usbnet.

axe loses 838 lines (37%) and ure loses 716 lines (36%).

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jul 19 04:17:34 2019 UTC (4 years, 8 months ago) by mrg
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.13: +4 -3 lines
Diff to previous 1.13 (colored) to selected 1.21 (colored)

call ure_stop_locked(), not ure_stop(), from ure_init_locked() to
avoid locking botch.  fixes assert reported by sc.dying.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jun 28 01:57:43 2019 UTC (4 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.12: +31 -14 lines
Diff to previous 1.12 (colored) to selected 1.21 (colored)

more smp cleanup for ure(4)/axen(4)/cdce(4):

- convert IFF_ALLMULTI to ETHER_F_ALLMULTI, using ETHER_LOCK()
- remove IFF_OACTIVE use, and simply check the ring count in start
- assert/take more locks
- XXX: IFF_RUNNING is not properly protected (all driver problem)
- fix axen_timer setting so it actually runs
- document a locking issue in stop callback:
  stop is called with the softc lock held, but the lock order
  in all other places is ifnet -> softc -> rx -> tx, so taking
  ifnet lock when softc lock is held would be problematic
- in rxeof check for stopping/dying more often.  i managed to
  trigger a pagefault in cdce_rxeof() when yanking an active
  device as it attempted to usbd_setup_xfer() on closed pipes.
- add missing USBD_MPSAFE and cdce_stopping resetting for cdce(4)

between this and other recent clean ups increase performance of
these drivers mostly.  some numbers (in mbit/sec):

	old:				new:
driver	in	out	in+out		in	out	in+out
----	--	---     ------		--	---	------
cdce	39	32	44		38	33	54
axen	44	34	45		48	37	42
ure	36	34	35		36	38	38

i'm not sure why axen drops a little with in+out.  cdce is
helped quite a lot, and ure a little.  it is disappointing that
ure does not outperform cdce -- it's the same actual hardware,
and the device-specific (ure) should outperform the generic
cdce driver...

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jun 24 04:42:06 2019 UTC (4 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.11: +10 -3 lines
Diff to previous 1.11 (colored) to selected 1.21 (colored)

actually set ure_stopping, and don't follow it in init.

pointed out by sc.dying on source-changes-d.  thanks.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jun 23 02:14:14 2019 UTC (4 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.10: +191 -84 lines
Diff to previous 1.10 (colored) to selected 1.21 (colored)

make cdce(4) and ure(4) usb and mpsafe:

- introduce locking ala smsc(4)/axen(4) style
- convert to mpsafe interfaces
- add tick task to cdce(4) to deal with missing watchdog, and
  actually make the watchdog do something
- convert DELAY() to usbd_delay_ms() in cdce(4) and don't increase
  the time in a potentially unbounded way
- remove spl calls

tested with network cable and usb adapter pullouts, reboots and
many many GBs of data transferred in either direction under load.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jun 16 21:04:08 2019 UTC (4 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) to selected 1.21 (colored)

Always increment, not just if we are queueing.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jun 16 14:47:49 2019 UTC (4 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.8: +5 -3 lines
Diff to previous 1.8 (colored) to selected 1.21 (colored)

PR/54297: sc dying: opacket of ure(4) is always 0

Revision 1.8.2.2 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:34 2019 UTC (4 years, 9 months ago) by christos
Branch: phil-wifi
Changes since 1.8.2.1: +1682 -0 lines
Diff to previous 1.8.2.1 (colored) to branchpoint 1.8 (colored) to selected 1.21 (colored)

Sync with HEAD

Revision 1.8.2.1, Sun Jun 9 13:35:47 2019 UTC (4 years, 9 months ago) by christos
Branch: phil-wifi
Changes since 1.8: +0 -1682 lines
FILE REMOVED

file if_ure.c was added on branch phil-wifi on 2019-06-10 22:07:34 +0000

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jun 9 13:35:47 2019 UTC (4 years, 9 months ago) by mrg
Branch: MAIN
CVS Tags: phil-wifi-20190609
Branch point for: phil-wifi
Changes since 1.7: +27 -18 lines
Diff to previous 1.7 (colored) to selected 1.21 (colored)

rearrange some parts of attach/detach to avoid partial-attach
leading to detach crash.

Revision 1.7 / (download) - annotate - [select for diffs], Tue May 28 07:41:50 2019 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.6: +9 -4 lines
Diff to previous 1.6 (colored) to selected 1.21 (colored)

 Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.

Revision 1.6 / (download) - annotate - [select for diffs], Thu May 23 13:10:52 2019 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.5: +6 -6 lines
Diff to previous 1.5 (colored) to selected 1.21 (colored)

 Whitespace fix (mainly tabify).

Revision 1.5 / (download) - annotate - [select for diffs], Thu May 23 10:57:29 2019 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.4: +11 -11 lines
Diff to previous 1.4 (colored) to selected 1.21 (colored)

-No functional change:
  - KNF
  - u_int*_t -> uint*_t.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Mar 7 14:00:25 2019 UTC (5 years ago) by msaitoh
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.3: +7 -2 lines
Diff to previous 1.3 (colored) to selected 1.21 (colored)

 Use pmf(9).

Revision 1.3 / (download) - annotate - [select for diffs], Sat Feb 9 07:50:47 2019 UTC (5 years, 1 month ago) by rin
Branch: MAIN
Changes since 1.2: +6 -4 lines
Diff to previous 1.2 (colored) to selected 1.21 (colored)

Print chip ID when attached.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Feb 6 22:54:41 2019 UTC (5 years, 1 month ago) by rin
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored) to selected 1.21 (colored)

Fix sign compare differently; instead of casting from int to unsigned,
casting from sizeof (and friends) to int.

Suggested by joerg@.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Feb 6 11:55:06 2019 UTC (5 years, 1 month ago) by rin
Branch: MAIN
Diff to selected 1.21 (colored)

Add ure(4): RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device.
Ported from OpenBSD. Support for RX/TX checksum offload added by myself.

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>