aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ubsec
Commit message (Collapse)AuthorAgeFilesLines
* Don't check maps for static DMA allocations against NULL to see if anJohn Baldwin2014-06-131-15/+15
| | | | | | | allocation succeeded. Instead, check the tag against NULL. Notes: svn path=/head/; revision=267448
* Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,John Baldwin2014-06-101-11/+0
| | | | | | | | | | | | don't create a map before calling bus_dmamem_alloc() (such maps were leaked). It is believed that the extra destroy of the map was generally harmless since bus_dmamem_alloc() often uses special maps for which bus_dmamap_destroy() is a no-op (e.g. on x86). Reviewed by: scottl Notes: svn path=/head/; revision=267340
* Snapshot. This passes the build test, but has not yet been finished or debugged.Mark Murray2013-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains: * Refactor the hardware RNG CPU instruction sources to feed into the software mixer. This is unfinished. The actual harvesting needs to be sorted out. Modified by me (see below). * Remove 'frac' parameter from random_harvest(). This was never used and adds extra code for no good reason. * Remove device write entropy harvesting. This provided a weak attack vector, was not very good at bootstrapping the device. To follow will be a replacement explicit reseed knob. * Separate out all the RANDOM_PURE sources into separate harvest entities. This adds some secuity in the case where more than one is present. * Review all the code and fix anything obviously messy or inconsistent. Address som review concerns while I'm here, like rename the pseudo-rng to 'dummy'. Submitted by: Arthur Mesh <arthurmesh@gmail.com> (the first item) Notes: svn path=/projects/random_number_generator/; revision=256042
* Yarrow wants entropy estimations to be conservative; the usual ideaMark Murray2013-09-061-1/+1
| | | | | | | | is that if you are certain you have N bits of entropy, you declare N/2. Notes: svn path=/projects/random_number_generator/; revision=255319
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long2013-08-121-15/+2
| | | | | | | | | | | | | | | | | | | | command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day Notes: svn path=/head/; revision=254263
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-6/+6
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* More conversions of drivers to use the PCI parent DMA tag.Scott Long2012-03-121-2/+2
| | | | Notes: svn path=/head/; revision=232874
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-5/+1
| | | | | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Notes: svn path=/head/; revision=227843
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+2
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Cast the bus_size_t to a intmax_t rather than assuming type-punning toWarner Losh2010-03-291-2/+2
| | | | | | | a size_t. Switch from %z to %j. Notes: svn path=/head/; revision=205844
* strict kobj sigs: fix assortment of device_detach and device_shutdown implsAndriy Gapon2009-06-111-2/+3
| | | | | | | | | | with common issue of having void return type instead of int Reviewed by: imp, current@ Approved by: jhb (mentor) Notes: svn path=/head/; revision=194023
* Add PCI IDs for the Broadcom 5825 incarnation.Philip Paeps2009-05-072-2/+6
| | | | | | | | Submitted by: Brian A. Seklecki <bseklecki -at- collaborativefusion.com> MFC after: 1 day Notes: svn path=/head/; revision=191894
* Overhaul driver/subsystem api's:Sam Leffler2007-03-211-25/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o make all crypto drivers have a device_t; pseudo drivers like the s/w crypto driver synthesize one o change the api between the crypto subsystem and drivers to use kobj; cryptodev_if.m defines this api o use the fact that all crypto drivers now have a device_t to add support for specifying which of several potential devices to use when doing crypto operations o add new ioctls that allow user apps to select a specific crypto device to use (previous ioctls maintained for compatibility) o overhaul crypto subsystem code to eliminate lots of cruft and hide implementation details from drivers o bring in numerous fixes from Michale Richardson/hifn; mostly for 795x parts o add an optional mechanism for mmap'ing the hifn 795x public key h/w to user space for use by openssl (not enabled by default) o update crypto test tools to use new ioctl's and add cmd line options to specify a device to use for tests These changes will also enable much future work on improving the core crypto subsystem; including proper load balancing and interposing code between the core and drivers to dispatch small operations to the s/w driver as appropriate. These changes were instigated by the work of Michael Richardson. Reviewed by: pjd Approved by: re Notes: svn path=/head/; revision=167755
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | 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
* Switch to using STAILQ_REMOVE_HEAD() instead of STAILQ_REMOVE_HEAD_UNTIL().Ruslan Ermilov2006-10-241-11/+11
| | | | | | | | | | | | | | | | Submitted by: Stepan A. Baranov This corresponds to OpenBSD rev. 1.134: : revision 1.134 : date: 2004/05/04 16:59:31; author: grange; state: Exp; lines: +10 -10 : Remove useless ``elm'' argument from the SIMPLEQ_REMOVE_HEAD macro. : This matches our SLIST behaviour and NetBSD's SIMPLEQ as well. : : ok millert krw deraadt Notes: svn path=/head/; revision=163648
* Trim trailing whitespace.John Baldwin2006-10-021-11/+11
| | | | Notes: svn path=/head/; revision=162969
* - Use m_getcl(), m_get(), and m_gethdr() rather than the older macros forJohn Baldwin2006-08-021-37/+26
| | | | | | | | | | | | | | | alloc'ing mbufs so that there is less error handling required. - Go ahead and account for the data space in the first mbuf before entering the loop to alloc more mbuf's. This simplifies the loop logic and avoids confusing Coverity. CID: 817 Reviewed by: sam Tested by: pjd Found by: Coverity Prevent (tm) Notes: svn path=/head/; revision=160931
* Handle errors in the same way it is done in safe(4).Pawel Jakub Dawidek2006-06-061-2/+4
| | | | Notes: svn path=/head/; revision=159341
* Don't increase hst_obytes field twice - it is already done at the beginingPawel Jakub Dawidek2006-06-061-1/+0
| | | | | | | | | of the function. It was wrong anyway, because we also support uio's structures, not only mbufs. Notes: svn path=/head/; revision=159340
* Use newly added functions to simplify the code.Pawel Jakub Dawidek2006-06-041-34/+12
| | | | Notes: svn path=/head/; revision=159242
* Use defines from cryptodev.h.Pawel Jakub Dawidek2006-06-041-2/+2
| | | | Notes: svn path=/head/; revision=159233
* - Remove HMAC_BLOCK_LEN, it serves no purpose.Pawel Jakub Dawidek2006-06-041-4/+6
| | | | | | | - Use defines of used algorithm instead of HMAC_BLOCK_LEN. Notes: svn path=/head/; revision=159232
* Add support for the CRD_F_KEY_EXPLICIT flag for both encryption andPawel Jakub Dawidek2006-06-041-67/+79
| | | | | | | authentication operations. Notes: svn path=/head/; revision=159225
* Don't forget to destroy the sc_freeqlock mutex on detach.Pawel Jakub Dawidek2006-06-041-0/+1
| | | | Notes: svn path=/head/; revision=159224
* Forgot to remove the line.Pawel Jakub Dawidek2006-05-231-1/+0
| | | | Notes: svn path=/head/; revision=158851
* Fix HMACs handling with uio's by not using crp_mac for storing calculatedPawel Jakub Dawidek2006-05-221-4/+5
| | | | | | | HMAC. crp_mac is going to be removed. Notes: svn path=/head/; revision=158830
* Protect the sc_needwakeup field with the sc_freeqlock mutex.Pawel Jakub Dawidek2006-05-221-4/+11
| | | | Notes: svn path=/head/; revision=158828
* Honor cri_mlen value.Pawel Jakub Dawidek2006-05-172-2/+13
| | | | | | | | | Reviewed by: sam Tested on: hifn(4), ubsec(4) Compile-tested: safe(4) Notes: svn path=/head/; revision=158705
* Since DELAY() was moved, most <machine/clock.h> #includes have beenPoul-Henning Kamp2006-05-161-1/+0
| | | | | | | unnecessary. Notes: svn path=/head/; revision=158651
* ubsec(4) doesn't support explicitly provided keys. Return an error insteadPawel Jakub Dawidek2006-04-101-0/+7
| | | | | | | of encrypting/decrypting data with a wrong key. Notes: svn path=/head/; revision=157640
* Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, returnWarner Losh2005-03-011-3/+3
| | | | | | | | BUS_PROBE_LOW_PRIORITY in stead of ifdef for devices that xl and vx both support so that xl will snarf them on up. Notes: svn path=/head/; revision=142880
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-063-3/+3
| | | | Notes: svn path=/head/; revision=139749
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-4/+4
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Use __FBSDID().David E. O'Brien2003-08-241-2/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Prefer new location of pci include files (which have only been in theWarner Losh2003-08-221-2/+2
| | | | | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD. Notes: svn path=/head/; revision=119287
* Change instances of callout_init that specify MPSAFE behaviour toSam Leffler2003-08-191-2/+1
| | | | | | | | use CALLOUT_MPSAFE instead of "1" for the second parameter. This does not change the behaviour; it just makes the intent more clear. Notes: svn path=/head/; revision=119137
* Mega busdma API commit.Scott Long2003-07-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs Notes: svn path=/head/; revision=117126
* Add support to eliminate a context switch per crypto op when using theSam Leffler2003-06-271-1/+1
| | | | | | | | | | | | | | software crypto device: o record crypto device capabilities in each session id o add a capability that indicates if the crypto driver operates synchronously o tag the software crypto driver as operating synchronously This commit also introduces crypto session id macros that cleanup their construction and querying. Notes: svn path=/head/; revision=116924
* Redo locking for proper SMP operation:Sam Leffler2003-06-022-52/+50
| | | | | | | | | | | o replace driver-global lock with three locks: one for the handling of mcr1 operations, one for handling of mcr2 operations, and one for the mcr1 free list o mark the interrupt handler MPSAFE o don't use locking on detach; disabling interrupts is sufficient (I think) Notes: svn path=/head/; revision=115747
* recognize the Sun Crypto 5821 and Crypto 1K cards;Sam Leffler2003-04-272-4/+22
| | | | | | | | | | they both use the Broadcom 5821 Submitted by: Panagiotis Astithas MFC after: 1 day Notes: svn path=/head/; revision=114105
* Including <sys/stdint.h> is (almost?) universally only to be able to usePoul-Henning Kamp2003-03-181-1/+0
| | | | | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble. Notes: svn path=/head/; revision=112367
* o add crypto driver glue for using the new rndtest driver/module; this isSam Leffler2003-03-112-6/+36
| | | | | | | | | conditional in each driver on foo_RNDTEST being defined_ o bring HIFN_DEBUG and UBSEC_DEBUG out to be visible options; they control the debugging printfs that are set with hw.foo.debug (e.g. hw.hifn.debug) Notes: svn path=/head/; revision=112124
* correct output byte count statistic collectionSam Leffler2003-03-111-2/+3
| | | | Notes: svn path=/head/; revision=112099
* add 5801 and 5802 recognition (somehow lost in transition from openbsd)Sam Leffler2003-02-272-2/+9
| | | | | | | Noticed by: Larry Baird <lab@gta.com> Notes: svn path=/head/; revision=111646
* o instead of applying arbitrary tunables, just honor the COP_F_BATCHSam Leffler2003-02-241-73/+46
| | | | | | | | | | | flag that can be marked on each symmetric op o eliminate hw.ubsec.maxbatch and hw.ubsec.maxaggr since they are not needed anymore o change ubsec_feed to return void instead of int since zero is always returned and noone ever looked at the return value Notes: svn path=/head/; revision=111416
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-6/+6
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* add 5823 device id's; this allows 5823 parts to function but you cannotSam Leffler2003-02-072-2/+7
| | | | | | | | | | use the AES functionality Submitted by: Jonathan Stone <jonathan@DSG.Stanford.EDU> MFC after: 1 day Notes: svn path=/head/; revision=110522
* shield kernel data structures so user apps can include this fileSam Leffler2003-02-071-0/+3
| | | | Notes: svn path=/head/; revision=110519
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-6/+6
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623