Commit Graph

1421 Commits

Author SHA1 Message Date
msaitoh 3cd62456f9 Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

 This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
2018-06-26 06:47:57 +00:00
msaitoh 313477deff Simplify bpf_mtap() call. No functional change. 2018-06-25 09:57:25 +00:00
msaitoh 4b508fb16e It's not required to include net/bpfdesc.h. Remove it. 2018-06-22 04:17:40 +00:00
sevan 842cda659d regen 2018-03-16 01:58:42 +00:00
sevan 2c814d8971 Add 3Com Wireless Bluetooth PC Card (version 3.0) 3CRWB6096B 2018-03-16 01:49:15 +00:00
sevan 8721565795 typo 2018-03-16 00:56:28 +00:00
dholland 32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
maxv ebdef72071 Fix memory leak, looks like there is still something wrong here. 2018-01-22 14:40:53 +00:00
christos b224e68c31 adjust for printf signature. 2017-12-09 00:53:55 +00:00
christos 4a1f5c48a9 coalesce the two copies of hexdump into libkern 2017-12-08 21:51:07 +00:00
msaitoh 35096a90e3 If error occured in the attach function, free resources and return. 2017-10-23 09:24:34 +00:00
jdolecek 62fb613155 move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
2017-10-20 07:06:05 +00:00
jdolecek 26cf68556f Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch
ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
2017-10-07 16:05:31 +00:00
christos 2ed5654a9c From bjoern johannesson, in netbsd-general... Reset the mask to 0, used to
be 0xa. Is it wrong in the cfe? Should this better be done via a quirk?
2017-08-01 12:15:21 +00:00
maxv 5d59d12047 two spl leaks, found by Mootja 2017-06-25 12:25:02 +00:00
christos 1a4bdd5296 remove my copyright. 2017-06-03 14:46:29 +00:00
nonaka 5ffb0503f3 wlan interfaces make interrupt routine running on softint context.
see http://mail-index.netbsd.org/tech-kern/2016/12/06/msg021281.html

tested device:
 * ath at pci: AR5212, AR5424
 * athn at pci: AR9287
 * ipw at pci: 2100BG
 * iwi at pci: 2915ABG
 * iwm at pci: 3165, 7260, 8260
 * iwn at pci: 4945, 6235
 * ral at pci: RT2560
 * rtwn at pci: RTL8192CE
2017-02-02 10:05:35 +00:00
maya d7b97dde8a Remove more dead code
RAY_DEF_NWID is a constant string and so is the length, it's
pointless the length is larger than zero.
2017-01-13 14:48:18 +00:00
maya 23a5d00df5 Remove dead code. RAY_DEF_NWID is a constant string, its length will never
be above 32.
2017-01-12 17:11:22 +00:00
ozaki-r dd8638eea5 Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input
The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
  - Where/When if_ipackets is counted up
  - Note that some drivers still update packet statistics in their own
    way (periodical update)
- Moved bpf_mtap run in softint
  - This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
2016-12-15 09:28:02 +00:00
ozaki-r c0e7885f20 Apply deferred if_start framework
if_schedule_deferred_start checks if the if_snd queue contains packets,
so drivers don't need to check it by themselves.
2016-12-08 01:12:00 +00:00
maya 0dc211a8da spaces to tabs 2016-11-27 00:21:43 +00:00
christos 9c7db92f68 MFREE -> m_free 2016-10-02 14:16:02 +00:00
msaitoh b14b7c4301 - Use aprint() more in isic_pcmcia_attach().
- Add missing aprint_naive("\n").
- swap device_xname() and cde->name in the output of a printf().
2016-07-14 09:27:14 +00:00
msaitoh b331f99208 KNF. No functional change. 2016-07-14 04:19:26 +00:00
msaitoh 71fbb921c3 KNF. No functional change. 2016-07-11 11:31:49 +00:00
msaitoh 8bc54e5be6 KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +00:00
ozaki-r d938d837b3 Introduce m_set_rcvif and m_reset_rcvif
The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
2016-06-10 13:27:10 +00:00
pgoyette 350743c8b4 Add 3Com 3CRWE777A to supported devices. From PR kern/39590 2016-06-01 23:37:33 +00:00
pgoyette dab8d4da3b Regen 2016-06-01 23:33:24 +00:00
pgoyette 117e30420c Ooopppsss - add it with the correct product ID. 2016-06-01 23:31:53 +00:00
pgoyette b9e27b4100 Add 3Com 3CRWE777A - from OpenBSD 2016-06-01 23:31:15 +00:00
skrll 4e8e66439e Merge nick-nhusb
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
    - kern/48308
    - uhub status notification improvements
    - umass(4) probe fix (applied to HEAD already)
    - ohci(4) short transfer fix
2016-04-23 10:15:27 +00:00
macallan ace06e28b0 fix tpyo 2016-03-11 22:09:54 +00:00
christos aa3efa577d PR/50949: David Binderman: Fix misplaced parens. 2016-03-11 18:34:15 +00:00
ozaki-r 9c4cd06355 Introduce softint-based if_input
This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
2016-02-09 08:32:07 +00:00
dholland 1fbab01a93 More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
2015-09-06 06:00:59 +00:00
ozaki-r b71bd7bda7 Remove leftover IPX-related stuffs
No objection on tech-kern and tech-net.
2015-05-25 08:29:01 +00:00
riastradh 233f556c2e Convert sys/dev to use <sys/rndsource.h>. 2015-04-13 16:33:23 +00:00
ozaki-r 433c9fcdef Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.

Discussed with martin@ and riastradh@.
2014-11-16 16:20:00 +00:00
tls ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
rmind 56a73a7d30 netbt: rename some attach/detach functions to have _pcb suffix, so
we could use standard attach/detach naming for pr_usrreq functions.
No functional change.
2014-05-20 18:25:54 +00:00
christos b01c54e6f1 kill unused array split 2014-05-12 02:26:19 +00:00
pgoyette 5b03462b1b Revert previous and fix correctly. Thanks, joerg 2014-04-21 22:40:00 +00:00
pgoyette c8008139a7 Insert { ... } to keep gcc happy when DPRINTF() macro is empty. 2014-04-21 20:24:21 +00:00
christos 2765468799 remove unused 2014-03-23 02:44:19 +00:00
christos 7d843710ef PR/48606: Lloyd Parkes: Drivers not using ifp->if_input but using ether_input
directly.
2014-02-21 02:10:40 +00:00
martin 4fbda0199d Remove an unused variable 2014-01-28 12:18:56 +00:00
joerg f0be17a3a4 Fix memset arguments. 2013-12-17 01:00:16 +00:00
christos c26593e016 remove unused variable 2013-10-17 21:06:47 +00:00