summaryrefslogtreecommitdiff
path: root/sys/dev/cp
AgeCommit message (Collapse)Author
2022-12-13retire cp(4) driverEd Maste
Sync serial (e.g. T1/T1/G.703) interfaces are obsolete, this driver includes obfuscated source, and has reported potential security issues. Differential Revision: https://reviews.freebsd.org/D33468
2022-12-13retire ce(4) driverEd Maste
Sync serial (e.g. T1/T1/G.703) interfaces are obsolete, this driver includes obfuscated source, and has reported potential security issues. Differential Revision: https://reviews.freebsd.org/D33467
2022-12-13Add deprecation notices to ce,cp sync serial driversEd Maste
And the related sconfig utility. Sync serial (e.g. E1/T1) interfaces are obsolete, and nobody responded to several inquires on the mailing lists about use of these drivers. Relnotes: Yes MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23928
2022-05-09cp: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2022-04-12Remove checks for __CC_SUPPORTS__INLINE assuming it is always true.John Baldwin
All supported compilers (modern versions of GCC and clang) support this. PR: 263102 (exp-run) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D34802
2022-04-12ce,cp: Remove pointless checks for <sys/cdefs.h>John Baldwin
Both of these headers check for _SYS_CDEFS_H_ after including <sys/param.h> which itself includes <sys/cdefs.h>. PR: 263102 (exp-run) Reviewed by: brooks, imp, emaste Differential Revision: https://reviews.freebsd.org/D34795
2021-10-22Retire synchronous PPP kernel driver sppp(4).Gleb Smirnoff
The last two drivers that required sppp are cp(4) and ce(4). These devices are still produced and can be purchased at Cronyx <http://cronyx.ru/hardware/wan.html>. Since Roman Kurakin <rik@FreeBSD.org> has quit them, they no longer support FreeBSD officially. Later they have dropped support for Linux drivers to. As of mid-2020 they don't even have a developer to maintain their Windows driver. However, their support verbally told me that they could provide aid to a FreeBSD developer with documentaion in case if there appears a new customer for their devices. These drivers have a feature to not use sppp(4) and create an interface, but instead expose the device as netgraph(4) node. Then, you can attach ng_ppp(4) with help of ports/net/mpd5 on top of the node and get your synchronous PPP. Alternatively you can attach ng_frame_relay(4) or ng_cisco(4) for HDLC. Actually, last time I used cp(4) back in 2004, using netgraph(4) instead of sppp(4) was already the right way to do. Thus, remove the sppp(4) related part of the drivers and enable by default the negraph(4) part. Further maintenance of these drivers in the tree shouldn't be a big deal. While doing that, remove some cruft and enable cp(4) compilation on amd64. The ce(4) for some unknown reason marks its internal DDK functions with __attribute__ fastcall, which most likely is safe to remove, but without hardware I'm not going to do that, so ce(4) remains i386-only. Reviewed by: emaste, imp, donner Differential Revision: https://reviews.freebsd.org/D32590 See also: https://reviews.freebsd.org/D23928
2020-03-20Use a separate copy of machdep.h in cp and ce driversEd Maste
Previously they included sys/dev/cx/machdep.h, but the cx driver was retired in r359178. These drivers haven't had real development for a decade or more so there's no real benefit in sharing this file; just copy it to the ce and cp subdirs. Notes: svn path=/head/; revision=359181
2017-02-20sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni
Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-02-22As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toSvatopluk Kraus
include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373 Notes: svn path=/head/; revision=295880
2015-05-22CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim
years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
2015-01-06In order to reduce use of M_EXT outside of the mbuf allocator andRobert Watson
socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=276750
2014-09-28Convert most BPF_TAP users to BPF_MTAP.Alexander V. Chernikov
MFC after: 2 weeks Notes: svn path=/head/; revision=272266
2014-09-19Remove ifq_drops from struct ifqueue. Now queue drops are accounted inGleb Smirnoff
struct ifnet if_oqdrops. Some netgraph modules used ifqueue w/o ifnet. Accounting of queue drops is simply removed from them. There were no API to read this statistic. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=271856
2014-09-19Mechanically convert to if_inc_counter().Gleb Smirnoff
Notes: svn path=/head/; revision=271849
2014-09-10Replace local copy-and-paste implementations of printmbuf() in severalRobert Watson
device drivers with calls to the centralised m_print() implementation. While the formatting and output details differ a little, the content is essentially the same, and it is unlikely anyone has used this debugging output in some time. This change reduces awareness of mbuf cluster allocation (and, especially, the M_EXT flag) outside of the mbuf allocator, which will make it easier to refine the external storage mechanism without disrupting drivers in the future. Style bugs are preserved. Reviewed by: bz, glebius MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=271373
2013-10-26The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff
to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
2013-05-10Fxi a bunch of typos.Eitan Adler
PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org> Notes: svn path=/head/; revision=250460
2013-01-30Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵Sofian Brabez
device_method_t arrays Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246128
2012-12-04Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff
malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
2011-12-29Fix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c,Dimitry Andric
using jkim's last patch (reviewed by bde) from here: http://docs.freebsd.org/cgi/mid.cgi?201010141558.03154.jkim MFC after: 1 week Notes: svn path=/head/; revision=228963
2010-10-13Revert r213793.Rui Paulo
Notes: svn path=/head/; revision=213795
2010-10-13Don't do a logical AND of the result of strcmp() with a constant.Rui Paulo
Found with: clang Notes: svn path=/head/; revision=213793
2010-05-03Add new tunable 'net.link.ifqmaxlen' to set default send interfaceMaxim Sobolev
queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month Notes: svn path=/head/; revision=207554
2009-11-17Always use a private timer instead of if_watchdog and if_timer to driveJohn Baldwin
the transmit watchdog. These drivers already used a private timer when compiled to use Netgraph. This change just makes them always use the private timer. Note that these drivers do not compile and are disconnected from the build due to TTY changes. Notes: svn path=/head/; revision=199407
2009-06-09Use new spelling of the NG_*LEN constants.Warner Losh
Notes: svn path=/head/; revision=193813
2009-02-15Remove debug.cp.mpsafenet: we no longer support running the networkRobert Watson
stack with conditional Giant acquisition, and IFF_NEEDSGIANT will be removed in the near future. Notes: svn path=/head/; revision=188661
2008-09-27Replace all calls to minor() with dev2unit().Ed Schouten
After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib Notes: svn path=/head/; revision=183397
2008-06-30Do not set IFF_DEBUG directly from the driver.Roman Kurakin
MFC after: 1 month. Notes: svn path=/head/; revision=180132
2007-07-27First in a series of changes to remove the now-unused Giant compatibilityRobert Watson
framework for non-MPSAFE network protocols: - Remove debug_mpsafenet variable, sysctl, and tunable. - Remove NET_NEEDS_GIANT() and associate SYSINITSs used by it to force debug.mpsafenet=0 if non-MPSAFE protocols are compiled into the kernel. - Remove logic to automatically flag interrupt handlers as non-MPSAFE if debug.mpsafenet is set for an INTR_TYPE_NET handler. - Remove logic to automatically flag netisr handlers as non-MPSAFE if debug.mpsafenet is set. - Remove references in a few subsystems, including NFS and Cronyx drivers, which keyed off debug_mpsafenet to determine various aspects of their own locking behavior. - Convert NET_LOCK_GIANT(), NET_UNLOCK_GIANT(), and NET_ASSERT_GIANT into no-op's, as their entire behavior was determined by the value in debug_mpsafenet. - Alias NET_CALLOUT_MPSAFE to CALLOUT_MPSAFE. Many remaining references to NET_.*_GIANT() and NET_CALLOUT_MPSAFE are still present in subsystems, and will be removed in followup commits. Reviewed by: bz, jhb Approved by: re (kensmith) Notes: svn path=/head/; revision=171613
2007-03-21Don't call bus_deactivate_resource() explicitly before callingYoshihiro Takahashi
bus_release_resource(). This is needed for pc98 by upcoming nexus related change. Notes: svn path=/head/; revision=167753
2007-02-23o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati
bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
2006-12-29Various bpf(4) related fixes to catch places up to the new bpf(4)John Baldwin
semantics. - Stop testing bpf pointers for NULL. In some cases use bpf_peers_present() and then call the function directly inside the conditional block instead of the macro. - For places where the entire conditional block is the macro, remove the test and make the macro unconditional. - Use BPF_MTAP() in if_pfsync on FreeBSD instead of an expanded version of the old semantics. Reviewed by: csjp (older version) Notes: svn path=/head/; revision=165632
2006-11-06Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson
specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net> Notes: svn path=/head/; revision=164033
2005-12-17trim trailing ^IDavid E. O'Brien
Notes: svn path=/head/; revision=153495
2005-09-27Restore if_cp.c 1.27Roman Kurakin
---------------------------- revision 1.27 date: 2005/09/19 03:10:16; author: imp; state: Exp; lines: +3 -2 Make sure that we call if_free(ifp) after bus_teardown_intr. Since we could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call. In fact, this change do nothing for this driver. It is protected from this by cp_destroy variable. This variable also protects driver from initiation of any activity from network stack with disabled intr handler with this change applied. Notes: svn path=/head/; revision=150624
2005-09-27Backout if_cp 1.26, if_ct 1.27, if_cx 1.47 by obrien:Roman Kurakin
---------------------------- revision 1.26 date: 2005/09/07 09:53:35; author: obrien; state: Exp; lines: +1452 -1453 Reorder code to not depend on an ISO-C illegal forward extern declaration. ---------------------------- Reason: do not move large functions location without serious reason. The same could be done by forward function declaration. Please do not enlarge diff without a reason any more. Backout if_cp 1.27 ---------------------------- revision 1.27 date: 2005/09/19 03:10:16; author: imp; state: Exp; lines: +3 -2 Make sure that we call if_free(ifp) after bus_teardown_intr. Since we could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call. Reason: bad previous commit. Would be restored by next commit. Notes: svn path=/head/; revision=150622
2005-09-19Make sure that we call if_free(ifp) after bus_teardown_intr. Since weWarner Losh
could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call. Notes: svn path=/head/; revision=150306
2005-09-07Reorder code to not depend on an ISO-C illegal forward extern declaration.David E. O'Brien
Notes: svn path=/head/; revision=149847
2005-08-09Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson
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 Notes: svn path=/head/; revision=148887
2005-07-09Use m_length (m, NULL) instead of m->m_pkthdr.len.Roman Kurakin
Problems reported by: strijar at urai dot ru Approved by: re (scottl) Notes: svn path=/head/; revision=147862
2005-07-09Protect from partially initialized channels.Roman Kurakin
Approved by: re (scottl) Notes: svn path=/head/; revision=147858
2005-07-09Space & alignment nits.Roman Kurakin
Approved by: re (scottl) Notes: svn path=/head/; revision=147856
2005-06-10Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis
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 Notes: svn path=/head/; revision=147256
2005-03-05Use BUS_PROBE_DEFAULT for pci probe return valueWarner Losh
Notes: svn path=/head/; revision=143161
2005-02-27Use dynamic major number allocation.Poul-Henning Kamp
Notes: svn path=/head/; revision=142719
2005-01-06Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh
Notes: svn path=/head/; revision=139749
2004-12-14Bring back ability to use FR support with sppp from Cronyx.Roman Kurakin
Notes: svn path=/head/; revision=138873
2004-12-13Make code MPSAFE.Roman Kurakin
You could turn this off by debug.mpsafenet=0 for full network stack or via debug.{cp|cx|ctau}.mpsafenet for cp(4), cx(4) and ctau(4) accordingly. MFC after: 10 days Notes: svn path=/head/; revision=138823