Commit Graph

82 Commits

Author SHA1 Message Date
Warner Losh
0b204f9c17 Add a boatload of devices from OpenBSD and NetBSD to kue and cdce.
Obtained From: OpenBSD/NetBSD
Approved by: re (blanket)
2007-06-23 06:47:43 +00:00
Warner Losh
a5509ec848 Use device_foo_t to declare kobj methods
Fix shutdown type to return int rather than void.
2007-06-18 22:25:46 +00:00
Warner Losh
bb92e05941 minor style(9) polishing
# but we need a usb_match function, if we don't already have one...
2007-06-18 02:15:58 +00:00
Warner Losh
6cf684e14a Remove USBGETSOFTC, USB_ATTACH_START, USB_DETACH_START and
USB_DECLARE_DRIVER_INIT from the usb network drivers.
2007-06-17 18:46:26 +00:00
Warner Losh
fc5d431363 Expand USB_MATCH_START 2007-06-17 16:24:49 +00:00
Warner Losh
778e5b6687 Expand USB_DETACH, USB_ATTACH and USB_MATCH inline. No functional
change, and MD5's appear to be the same.
2007-06-13 05:37:59 +00:00
Warner Losh
645016c0e4 Expand USB_ATTACH_{ERROR,SUCCESS}_RETURN inline and eliminate from
usb_port.h.  They aren't needed, and are a legacy of this code's past.
2007-06-12 15:37:19 +00:00
Warner Losh
9b1defb041 Prefer device_printf to printf
Remove keu_unit from softc

# this change saves about 180 bytes in the module, all in text
2007-06-11 05:50:47 +00:00
Warner Losh
e591b223d8 The devinfo stuff has been moved up into the parent bus. There's no
need to do it at all anymore.  Remove it from here.  Expand
USB_ATTACH_SETUP inline now that it is one line and we're moving away
from the compat macros.  Remove some bzero calls that turn out not be
be necessary.
2007-06-09 06:31:07 +00:00
Christian Brueffer
3f054080e6 Add missing curly braces.
Approved by:	rwatson (mentor)
2007-05-12 05:56:58 +00:00
Christian Brueffer
224aecbcdf Remove compat ifdefs for FreeBSD versions < 500014, makes the code
quite a bit easier to read.

Approved by:	rwatson (mentor)
MFC after:	1 weeks
2007-05-12 05:53:53 +00:00
Florent Thoumie
cfa3f4d8ab Add support for Psion Gold Port Ethernet USB NIC.
PR:		usb/102296
Submitted by:	Volker <volker@vwsoft.com>
MFC after:	3 days
2006-10-07 18:03:39 +00:00
Warner Losh
2deae8fa2f More removing compatibility macros.
md5 still the same.

"Dave, stop.  I feel my mind slipping away." -- hal
2006-09-07 00:06:42 +00:00
Warner Losh
56635f6bd3 s/Static/static/g
s/device_ptr_t/device_t/g

No md5 changes in the .o's

# Note to the md5 tracking club: $FreeBSD$ changes md5 after every commit
# so you need to checkout -kk to get $FreeBSD$ instead of the actual value
# of the keyword.
2006-09-06 23:44:25 +00:00
Ruslan Ermilov
4a0d6638b3 - Store pointer to the link-level address right in "struct ifnet"
rather than in ifindex_table[]; all (except one) accesses are
  through ifp anyway.  IF_LLADDR() works faster, and all (except
  one) ifaddr_byindex() users were converted to use ifp->if_addr.

- Stop storing a (pointer to) Ethernet address in "struct arpcom",
  and drop the IFP2ENADDR() macro; all users have been converted
  to use IF_LLADDR() instead.
2005-11-11 16:04:59 +00:00
Ruslan Ermilov
4180ad4d15 Add missing mtx_destroy() when if_alloc() fails.
Add missing if_free() when mii_phy_probe() fails.
Put if_free() into the correct #ifdef in detach().
2005-09-16 09:20:58 +00:00
Robert Watson
13f4c340ae 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
MFC after:	7 days
2005-08-09 10:20:02 +00:00
Robert Watson
13b203d0d7 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>
MFC after:		1 week
2005-08-03 00:18:35 +00:00
Brooks Davis
fc74a9f93a 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
Maxim Sobolev
f1cc4b713e Add missed KUE_UNLOCK(). This is NOOP yet, but may be handy later on. 2005-03-25 12:53:26 +00:00
Maxim Sobolev
5135f8e687 Fix breakage in the previous commit caused by the last-minute change. 2005-03-25 12:50:57 +00:00
Maxim Sobolev
d521dc21e7 Move Rx/Tx lists management routines into central location. 2005-03-25 12:42:30 +00:00
Maxim Sobolev
8a9cf808e6 Move xxx_newbuf() function, which was the same in all drivers into central
location.
2005-03-25 00:44:21 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Robert Watson
1510469e95 Mark USB ethernet devices as IFF_NEEDSGIANT, since the USB framework
if_start routines cannot currently be entered without Giant.  When
the kernel is running with debug.mpsafenet != 0, this will defer
if_start execution to a task queue thread holding Giant, which may
introduce additional latency, but avoid incorrect execution.

Suggested by:	dfr
2004-08-11 03:38:55 +00:00
Warner Losh
d1458cfdf4 MFp4: First batch of dev/usb/usbdevs.h -> usbdevs.h changes. 2004-06-27 12:41:44 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Maxime Henrion
866a788cc2 We don't need to initialize if_output, ether_ifattach() does it
for us.
2004-05-23 16:11:53 +00:00
Ian Dowse
eadf519a78 Replace the static "qdat" structure with a per-instance softc field
in all USB ethernet drivers. The qdat structure contains a pointer
to the interface's struct ifnet and is used to process incoming
packets, so simultaneous use of two similar devices caused crashes
and confusion.

The if_udav driver appeared in the tree since Daan's PR, so I made
similar changes to that driver too.

PR:		kern/59290
Submitted by:	Daan Vreeken <Danovitsch@Vitsch.net>
2004-05-23 12:35:25 +00:00
Matthew N. Dodd
e3bbbec2ca Announce ethernet MAC addresss in ether_ifattach(). 2004-03-14 07:12:25 +00:00
Johan Karlsson
33a3109794 Remove duplicate
#include <sys/cdefs.h>
__FBSDID(...);

Leave the one matching the other files in this directory.
2003-11-14 11:09:45 +00:00
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
Josef Karthauser
cd719b55bd Make it easier to run this code on RELENG_4.
Submitted by:	luoqi
2003-10-04 21:41:01 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
John-Mark Gurney
fb393615ed add missing machine/bus.h headers that are now necessary because of the
bus_dma addition.
2003-07-16 02:20:14 +00:00
Matthew N. Dodd
f246e4a17f - Express hard dependencies on bus (pci, isa, pccard) and
network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
  such abuse isn't really needed.  (And if we do need type information
  associated with a module then we should make it explicit and not
  use hacks.)
2003-04-15 06:37:30 +00:00
Murray Stokely
65793abdff Add ID for Kawasaki LSI Inc. USB-Ethernet, rev 1.00/2.02 adapter.
PR:		kern/50064
Submitted by:	Scott Renfro <scott@renfro.org>
MFC after:	3 days
2003-04-07 10:26:59 +00:00
David E. O'Brien
8368cf8f75 Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Sam Leffler
673d91916d network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets
  up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls

Reviewed by:	many
Approved by:	re
2002-11-14 23:54:55 +00:00
Ian Dowse
417d8f25fc Re-fetch the interface handle after setting the config number,
because the previous interface handle gets freed when the config
number is set. This fixes a problem where memory could be accessed
after it was freed when the interface was ifconfig'd up.

Reviewed by:	n_hibma
2002-07-15 14:37:36 +00:00
Josef Karthauser
906e5d2c1b We not long need to use USBD_NO_TSLEEP. 2002-04-07 12:19:50 +00:00
Josef Karthauser
3847d1fda8 MFNetBSD: if_aue.c (1.26), if_auereg.h (1.6), if_cue.c (1.10),
if_cuereg.h (1.5), if_kue.c (1.11), if_kuereg.h (1.5)

    date: 2000/03/02 12:37:51;  author: augustss;
    Use ratecheck() to limit error messages on disconnect.
    Break out some common functionality.
2002-04-07 12:04:02 +00:00
Josef Karthauser
6a69a08a22 Use the UE_GET_XFERTYPE macro. 2002-04-06 21:28:57 +00:00
Josef Karthauser
47c61eef1b Rename foo_gone to foo_dying, in keeping with the rest of the usb code. 2002-04-06 20:17:13 +00:00
Josef Karthauser
3d9e00aa02 Replace device_t with device_ptr_t. 2002-04-06 19:55:52 +00:00
John Baldwin
6008862bc2 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
Josef Karthauser
c8d05bc5f5 Use ANSI prototypes and declarations. 2002-04-02 11:54:28 +00:00
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00