Commit Graph

48 Commits

Author SHA1 Message Date
christos
aa3d6ec155 revert the 0x% -> %# change for fixed width formats pointed out by uwe. 2020-03-14 02:35:33 +00:00
christos
d3dde16c1a PR/55068: sc.dying: Fix printf formats:
- no %s/%p for kernel log
- 0x% -> %#
- always %j for kernel log
2020-03-13 18:17:40 +00:00
maxv
97b908dcc6 localify 2019-12-01 08:23:09 +00:00
maxv
ed42779f0f Fix NULL deref. Found by vHCI. 2019-09-14 15:22:31 +00:00
mrg
3b24a1344e remove explicit 'extern struct cfdriver <my>_cd;' and use ioconf.h 2019-05-05 03:17:54 +00:00
skrll
b842161189 PR kern/52931 Kernel panics with Atheros usb wireless interface
Audit the flags to usbd_create_xfer so that USBD_FORCE_SHORT_XFER is
supplied wherever such a transfer is setup.  We can drop
USBD_SHORT_XFER_OK as it has not bearing on number of TDs
2018-01-21 13:57:11 +00:00
skrll
c5a90c121f Whitespace 2016-12-04 10:08:26 +00:00
skrll
a7c71d30d6 +#include "opt_usb.h" 2016-11-25 12:56:29 +00:00
msaitoh
8bc54e5be6 KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +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
martin
54a1f468e1 Fix botch in previous 2013-09-15 19:27:22 +00:00
martin
744d947a38 Remove unused variables 2013-09-15 15:49:38 +00:00
skrll
897388ea60 Consistent/Correct error message from failing usbd_set_config.
Use aprint_error_dev.
2012-12-27 16:42:32 +00:00
mrg
73104627df pull down from usbmp branch:
- rename usb_detach_{wake,waitup}() to usb_detach_{wake,waitup}old()
- use some c99 struct .initialisers
2012-03-06 03:35:29 +00:00
he
e1daf82a90 Include <sys/lwp.h> for access to curlwp, now used in various locking ops. 2012-02-23 13:31:13 +00:00
mrg
83cc5b2226 assert kernel lock is held in a few places in inside scsipi.
lock the kernel when calling into scsipi from umass and usscanner.

with these two in place on usbmp branch, umass appears stable.
2012-02-20 20:09:08 +00:00
jakllsch
71fd84843e Revert previous due to active usbmp branch(es). 2011-12-23 00:51:43 +00:00
jakllsch
7f2b9b9ad4 Adjust-away inconsistent and trailing whitespace. 2011-12-22 20:06:59 +00:00
dyoung
49337c8880 Stop using the compatibility macros USB_ATTACH(), USB_DETACH(),
USB_MATCH(), et cetera.  These files produce the same assembly
(according to objdump -d) before and after the change
2010-11-03 22:34:23 +00:00
dyoung
efc6bfe74a Simplify device-activation hooks. 2009-12-06 21:40:31 +00:00
plunky
5fab894c54 fix up USB drivers printing of autoconf information
1. expand the USB_ATTACH_SETUP macro (requested by jmcneill)

2. reorder the attach function so that the first thing it does is print
   newlines.

3. after this, we can call usbd_devinfo_alloc(), which polls the device
   allowing a context switch, and aprint_normal() the device information.

this avoids problems where autoconf messages are getting mixed up.
2009-09-23 19:07:19 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
cegger
09d5e20c11 make this build with USSCANNER_DEBUG 2008-05-25 07:04:10 +00:00
cube
3624455eba Split device_t and softc for all USB device drivers, and related cosmetic
changes.

Matthias Drochner kindly reviewed this patch, and tested ums, ubt, uaudio
and ral.  I tested umass myself.
2008-05-24 16:40:58 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dyoung
0b1dce29ae Use device_t and its accessor functions.
Register _childdetached methods with drivers that attach children.
Wait to set child references to NULL there, instead of doing that
in the detach method.

Replace many uses of USB_DECLARE_DRIVER() with CFATTACH_DECL2().
2008-02-18 05:24:24 +00:00
drochner
8258b792b7 Introduce different autoconf interface attributes for USB drivers
matching (and handling) a whole device and those which match an
interface only. This will allow to enforce some rules, eg that
the former don't use interface information for matching or that the
latter don't modify global device state.
The previous way left too much freedom do the drivers which led to
inconsistencies and abuse.
For now, I've not changed locators and submatch rules, this will
happen later.
There should not be any change in behaviour, except in the case of
some drivers which did behave inconsistently:
if_atu, if_axe, uep: matched the configured device in the interface
 stage, but did configuration again. I've converted them to match
 in the device stage.
ustir, utoppy: matched in the interface stage, but only against
 vendor/device information, and used any configuration/interface
 without checking. Changed to match in device stage, and added
 some simple code to configure and use the first interface.
If you have one of those devices, please test!
2007-03-13 13:51:53 +00:00
martin
a6d16a29ee If no scsibus is configured, do not silently fail the attach but print
a message pointing at the usscanner(4) manual page.
Addresses PR port-i386/22393.
2006-11-26 20:14:41 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
augustss
834327c847 Don't keep the devinfo string on the stack, instead use malloc/free.
This should cure some rare stack overflows.
2005-05-11 10:02:28 +00:00
augustss
91c4478386 Check if we have any SCSI busses so this file doesn't cause link errors
if used without SCSI.
2005-04-29 17:52:46 +00:00
thorpej
df9803ce96 Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding.  Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes.  Place items described
by the SCSI Primary Commands document into scsi_spc.h.
2005-02-21 00:29:06 +00:00
itojun
300aa0dcd5 use bounded string ops (snprintf, strl*) 2004-04-23 17:25:25 +00:00
tls
05e1bf3ec9 MAXBSIZE->MAXPHYS -- this mysteriously broke all *kinds* of stuff when
MAXBSIZE had been reduced by the user (e.g. transfers from umass disks).
2004-03-22 14:55:42 +00:00
simonb
4e3613273b Remove breaks after returns, unreachable returns and returns after
returns(!).
2002-09-23 05:51:10 +00:00
wiz
52078f1201 Correct function name in some debug printfs. (More could be done.) 2002-07-26 00:01:30 +00:00
augustss
86650920c9 Get rid of trailing white space. 2002-07-11 21:14:24 +00:00
lukem
667807e40c add RCSIDs 2001-11-13 06:24:53 +00:00
augustss
e67bc465a2 Make it compile with DEBUG after SCSI changes. 2001-04-28 14:48:39 +00:00
bouyer
937a7a3ed9 Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-25 17:53:04 +00:00
augustss
cbda952879 Make sure driver attach/detach events are generated in a consistent manner. 2001-01-23 14:04:13 +00:00
tv
e58532a4bf No-op commit to force update to a non-"-kk" revision. 2001-01-18 17:47:58 +00:00
augustss
845a2d5b53 Fix comment typo. 2001-01-15 03:52:03 +00:00
augustss
d03f7a8f4b Mention that I found protocol info in the Linux driver. 2001-01-11 06:33:22 +00:00
augustss
7d90b0cb9c Note that I got information about the protocol from the Linux driver. 2001-01-11 06:20:04 +00:00
augustss
8765aa2c42 Add a driver for HP5300 which uses a homebrew SCSI-over-USB protocol.
Furthermore, it uses Avisions scanner-over-SCSI protocol (but that's
not visible in the driver).
Thanks to Lloyd Parkes for testing and debugging and to Jukka Marin for
testing.
XXX This driver should be extended to handle Microtek scanners as well.
2001-01-11 06:00:31 +00:00