aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firewire
Commit message (Collapse)AuthorAgeFilesLines
* Update sbp_targ such that it can actually handle multiple CTIO's during ↵Sean Bruno2012-01-251-79/+314
| | | | | | | | | operation PR: kern/119575 Notes: svn path=/head/; revision=230558
* ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againKevin Lo2012-01-071-1/+0
| | | | | | | Reviewed by: yongari Notes: svn path=/head/; revision=229767
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-222-9/+8
| | | | | | | | | | | | | 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-074-4/+5
| | | | | | | | | 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
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-075-5/+5
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Add descriptor sense support to CAM, and honor sense residuals properly inKenneth D. Merry2011-10-032-24/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CAM. Desriptor sense is a new sense data format that originated in SPC-3. Among other things, it allows for an 8-byte info field, which is necessary to pass back block numbers larger than 4 bytes. This change adds a number of new functions to scsi_all.c (and therefore libcam) that abstract out most access to sense data. This includes a bump of CAM_VERSION, because the CCB ABI has changed. Userland programs that use the CAM pass(4) driver will need to be recompiled. camcontrol.c: Change uses of scsi_extract_sense() to use scsi_extract_sense_len(). Use scsi_get_sks() instead of accessing sense key specific data directly. scsi_modes: Update the control mode page to the latest version (SPC-4). scsi_cmds.c, scsi_target.c: Change references to struct scsi_sense_data to struct scsi_sense_data_fixed. This should be changed to allow the user to specify fixed or descriptor sense, and then use scsi_set_sense_data() to build the sense data. ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data manually. cam_periph.c: Use scsi_extract_sense_len() instead of using scsi_extract_sense() or accessing sense data directly. cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16. The change of struct scsi_sense_data from 32 to 252 bytes changes the size of struct ccb_scsiio, but not the size of union ccb. So the version must be bumped to prevent structure mis-matches. scsi_all.h: Lots of updated SCSI sense data and other structures. Add function prototypes for the new sense data functions. Take out the inline implementation of scsi_extract_sense(). It is now too large to put in a header file. Add macros to calculate whether fields are present and filled in fixed and descriptor sense data scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry data, and we'll assume a direct access device in that case. Changed the SCSI RESERVED sense key name and description to COMPLETED, as it is now defined in the spec. Change the error recovery action for a number of read errors to prevent lots of retries when the drive has said that the block isn't accessible. This speeds up reconstruction of the block by any RAID software running on top of the drive (e.g. ZFS). In scsi_sense_desc(), allow for invalid sense key numbers. This allows calling this routine without checking the input values first. Change scsi_error_action() to use scsi_extract_sense_len(), and handle things when invalid asc/ascq values are encountered. Add a new routine, scsi_desc_iterate(), that will call the supplied function for every descriptor in descriptor format sense data. Add scsi_set_sense_data(), and scsi_set_sense_data_va(), which build descriptor and fixed format sense data. They currently default to fixed format sense data. Add a number of scsi_get_*() functions, which get different types of sense data fields from either fixed or descriptor format sense data, if the data is present. Add a number of scsi_*_sbuf() functions, which print formatted versions of various sense data fields. These functions work for either fixed or descriptor sense. Add a number of scsi_sense_*_sbuf() functions, which have a standard calling interface and print the indicated field. These functions take descriptors only. Add scsi_sense_desc_sbuf(), which will print a formatted version of the given sense descriptor. Pull out a majority of the scsi_sense_sbuf() function and put it into scsi_sense_only_sbuf(). This allows callers that don't use struct ccb_scsiio to easily utilize the printing routines. Revamp that function to handle descriptor sense and use the new sense fetching and printing routines. Move scsi_extract_sense() into scsi_all.c, and implement it in terms of the new function, scsi_extract_sense_len(). The _len() version takes a length (which should be the sense length - residual) and can indicate which fields are present and valid in the sense data. Add a couple of new scsi_get_*() routines to get the sense key, asc, and ascq only. mly.c: Rename struct scsi_sense_data to struct scsi_sense_data_fixed. sbp_targ.c: Use the new sense fetching routines to get sense data instead of accessing it directly. sbp.c: Change the firewire/SCSI sense data transformation code to use struct scsi_sense_data_fixed instead of struct scsi_sense_data. This should be changed later to use scsi_set_sense_data(). ciss.c: Calculate the sense residual properly. Use scsi_get_sense_key() to fetch the sense key. mps_sas.c, mpt_cam.c: Set the sense residual properly. iir.c: Use scsi_set_sense_data() instead of building sense data by hand. iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data directly. umass.c: Use scsi_set_sense_data() to build sense data. Grab the sense key using scsi_get_sense_key(). Calculate the sense residual properly. isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key values. Calculate and set the sense residual. MFC after: 3 days Sponsored by: Spectra Logic Corporation Notes: svn path=/head/; revision=225950
* When we see an interrupt status of 0xffffffff, check to see if theWarner Losh2011-06-211-2/+3
| | | | | | | | | child is still present. If not, return 'handled' and don't print anything (this is expected behavior). We expect an interrupt on eject, power-down and/or shutdown. Notes: svn path=/head/; revision=223353
* Allocate the DMA memory shared between the host and the controller asMarius Strobl2011-03-112-3/+4
| | | | | | | | | coherent. MFC after: 2 weeks Notes: svn path=/head/; revision=219543
* Remove references to MAKEDEV(8)Doug Barton2010-11-151-4/+0
| | | | Notes: svn path=/head/; revision=215334
* Fix grammar.Rebecca Cran2010-10-181-2/+2
| | | | Notes: svn path=/head/; revision=214021
* bus_add_child: change type of order parameter to u_intAndriy Gapon2010-09-102-3/+3
| | | | | | | | | | | | | This reflects actual type used to store and compare child device orders. Change is mostly done via a Coccinelle (soon to be devel/coccinelle) semantic patch. Verified by LINT+modules kernel builds. Followup to: r212213 MFC after: 10 days Notes: svn path=/head/; revision=212413
* Cast a bus_size_t to a (size_t) to use %zd specifier. Not quite theWarner Losh2010-03-291-1/+1
| | | | | | | | right thing to do, but it is in compat code I don't want to sort out at the moment. Notes: svn path=/head/; revision=205842
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-071-3/+3
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.Robert Noland2009-12-292-3/+5
| | | | | | | | | | | | | | | | This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime... Notes: svn path=/head/; revision=201223
* Revert previous commit and add myself to the list of people who shouldPoul-Henning Kamp2009-09-082-3/+2
| | | | | | | know better than to commit with a cat in the area. Notes: svn path=/head/; revision=196970
* Add necessary include.Poul-Henning Kamp2009-09-082-2/+3
| | | | Notes: svn path=/head/; revision=196969
* Fix what seems to be an obvious typo preventing the body of theRoman Divacky2009-06-231-1/+1
| | | | | | | | | if statement to ever be executed. Approved by: ed (mentor) Notes: svn path=/head/; revision=194687
* Rename the host-related prison fields to be the same as the host.*Jamie Gritton2009-06-131-1/+1
| | | | | | | | | | parameters they represent, and the variables they replaced, instead of abbreviated versions of them. Approved by: bz (mentor) Notes: svn path=/head/; revision=194118
* When user_frac in the polling subsystem is low it is going to busy theAttilio Rao2009-05-302-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible. In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped). Bump __FreeBSD_version in order to signal such situation. Reviewed by: emaste Sponsored by: Sandvine Incorporated Notes: svn path=/head/; revision=193096
* Place hostnames and similar information fully under the prison system.Jamie Gritton2009-05-291-2/+4
| | | | | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor) Notes: svn path=/head/; revision=193066
* Minor updates as a precursor to fixing sbp_targSean Bruno2009-04-072-2/+6
| | | | | | | | | | firewire.c -- expand a comment and repair a typo sbp.h -- define Logical Unit Reset so it can be used in sbp_targ Reviewed by: scottl@freebsd.org Notes: svn path=/head/; revision=190792
* Reviewed by: scott (scottl@freebsd.org)Sean Bruno2009-03-171-32/+52
| | | | | | | | | | | | | | | Obtained from: Hideotshi Shimokawa This update is based on comments from Hidetoshi. Changeset 183550 removed the call to crom_load() in fw_busreset(). Restore that call such that the Configuration ROM is valid. Stash and update fwdev settings in fw_explore_node() so that negotiation works again. Notes: svn path=/head/; revision=189928
* remove now-redunant cardbus attachment.Warner Losh2009-03-091-1/+0
| | | | Notes: svn path=/head/; revision=189575
* Enhance debugging mode by storing the string "BB:TT:LL" once and useSean Bruno2009-02-181-150/+143
| | | | | | | | | | | | | | | it instead of overloading sbp_show_sdev_info(). replace calls to printf with calls to device_printf and cleanup debug messages Remove a bit of dead, commented out code. Reviewed by: scottl(mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=188756
* Introduce 1394a-2000 extended PHY Self ID packets.Sean Bruno2009-02-172-8/+29
| | | | | | | | | | | | | Deprecate unused phy_delay Self ID field as it was removed by 1394a-2000. Attempt to parse extended Self ID PHY packets if they are detected Reviewed by: scottl (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=188726
* Simplify some debugging messages and try to consolodate some of the moreSean Bruno2009-02-171-65/+109
| | | | | | | | | | | | | | interesting conditional printf's into single device_printf's Change a couple of variable names so that I don't have to trace what they acutally do anymore. Enable the display of the Self ID PHY packet if firewire_debug > 0 Reviewed by: scottl(mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=188722
* Synopsis:Sean Bruno2009-02-171-6/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If speed of link between two devices is slower than the reported max speed of both endpoints, the current driver will fail and be unable to negotiate. Summary: Test negotiated speed by reading the CSRROM into a dummy variable. If that read fails, decrement our speed and retry. If all else fails, go to lowest speed possible(0). Report speed to the user. Add display of the Bus Info Block when debug.firewire_debug > 1 Support the Bus Info Block(1394a-2000) method of speed detection. I also should note that I am moving "hold_count" to 0 for future releases. This variable determines how many bus resets to "hold" a removed firewire device before deletion. I don't feel this is useful and will probably drop support for this sysctl in the future. Reviewed by: scottl(mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=188704
* Update the Self ID structure to conform to 1394a-2000.Sean Bruno2009-02-131-18/+50
| | | | | | | | | Delete the unused defines. Reviewed by: scottl Notes: svn path=/head/; revision=188585
* Remove redundant while () from loop.Sean Bruno2009-02-131-1/+1
| | | | | | | | Submitted by: Ganbold <ganbold@micom.mng.net> Reviewed by: scottl Notes: svn path=/head/; revision=188584
* Enhance debug messages and attempt to unify them into one format where possible.Sean Bruno2009-02-121-10/+12
| | | | | | | Reviewed by: scottl Notes: svn path=/head/; revision=188509
* Update comments around various structs.Sean Bruno2009-02-123-9/+27
| | | | | | | Add speeds S800, S1600 and S3200 Notes: svn path=/head/; revision=188508
* Do not self-initialize a variable.Max Khon2009-02-092-2/+2
| | | | | | | | Found with: Coverity Prevent(tm) CID: 3864, 3865 Notes: svn path=/head/; revision=188394
* Remove unused variable.Max Khon2009-02-091-2/+1
| | | | | | | | Found with: Coverity Prevent(tm) CID: 3693 Notes: svn path=/head/; revision=188393
* Delete fwohci_filt() as it is now unusedSean Bruno2009-02-031-1/+0
| | | | | | | | Obtained from: Marius Strobl <marius@alchemy.franken.de> MFC after: 2 weeks Notes: svn path=/head/; revision=188079
* Some updates and bug squashing in the firewire stack.Sean Bruno2009-02-015-69/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the interupt handler to a driver_intr_t type function as it was trying to do way to much for a lightweight filter interrupt function. Introduce much more locking around fc->mtx. Tested this for lock reversals and other such lockups. Locking seems to be working better, but there is much more to do with regard to locking. The most significant lock is in the BUS RESET handler. It was possible, before this checkin, to set a bus reset via "fwcontrol -r" and have the BUS RESET handler fire before the code responsible for asserting BUS RESET was complete. This locking fixes that issue. Move some of the memory allocations in the fc struct to the attach function in firewire.c Rework the businfo.generation indicator to be merely a on/off bit now. It's purpose according to spec is to notify the bus that the config ROM has changed. That's it. Catch and squash a possible panic in SBP where in the SBP_LOCK was held during a possible error case. The error handling code would definitely panic as it would try to acquire the SBP_LOCK on entrance. Catch and squash a camcontrol/device lockup when firewire drives go away. When a firewire device was powered off or disconnected from the firewire bus, a "camcontrol rescan all" would hang trying to poll removed devices as they were not properly detached. Don't do that. Approved by: scottl MFC after: 2 weeks Notes: svn path=/head/; revision=187993
* Step 1.5 of importing the network stack virtualization infrastructureMarko Zec2008-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the vimage project, as per plan established at devsummit 08/08: http://wiki.freebsd.org/Image/Notes200808DevSummit Introduce INIT_VNET_*() initializer macros, VNET_FOREACH() iterator macros, and CURVNET_SET() context setting macros, all currently resolving to NOPs. Prepare for virtualization of selected SYSCTL objects by introducing a family of SYSCTL_V_*() macros, currently resolving to their global counterparts, i.e. SYSCTL_V_INT() == SYSCTL_INT(). Move selected #defines from sys/sys/vimage.h to newly introduced header files specific to virtualized subsystems (sys/net/vnet.h, sys/netinet/vinet.h etc.). All the changes are verified to have zero functional impact at this point in time by doing MD5 comparision between pre- and post-change object files(*). (*) netipsec/keysock.c did not validate depending on compile time options. Implemented by: julian, bz, brooks, zec Reviewed by: julian, bz, brooks, kris, rwatson, ... Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation Notes: svn path=/head/; revision=183550
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-272-2/+2
| | | | | | | | | | | | | | | | | | 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
* Commit step 1 of the vimage project, (network stack)Bjoern A. Zeeb2008-08-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch Notes: svn path=/head/; revision=181803
* - Fix panic on detach.Hidetoshi Shimokawa2008-05-102-4/+4
| | | | | | | | | - Fix a comment. MFC after: 2 weeks Notes: svn path=/head/; revision=178915
* - Disable interrupts on suspend to eliminate excessiveHidetoshi Shimokawa2008-05-101-4/+9
| | | | | | | | | | 'device physically ejected?' message on resume. - Fix memory leak on resume reported by kiyohara at netbsd.org. MFC after: 2 weeks Notes: svn path=/head/; revision=178911
* Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.Ruslan Ermilov2008-03-252-26/+10
| | | | | | | | | | | | | Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation. Notes: svn path=/head/; revision=177599
* Rename the kthread_xxx (e.g. kthread_create()) callsJulian Elischer2007-10-201-2/+2
| | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls. Notes: svn path=/head/; revision=172836
* Protect transaction labels by its own lock to reduce lock contention.Hidetoshi Shimokawa2007-07-202-12/+17
| | | | | | | Approved by: re (rwatson) Notes: svn path=/head/; revision=171513
* Improve acquisition of transaction labels.Hidetoshi Shimokawa2007-07-152-20/+17
| | | | | | | | | | | - Keep last transaction label for each destination. - If the next label is not free, just give up. - This should reduce CPU load for TX on if_fwip under heavy load. Approved by: re (hrs) Notes: svn path=/head/; revision=171457
* Fix a bug of retrieving configuration ROM.Hidetoshi Shimokawa2007-07-081-2/+2
| | | | | | | | | | | | | - Handle directories and leaves other than unit directories and text leaves correctly. - Now we can retrieve CROM of iSight correctly. Approved by: re (hrs) Tested by: flz MFC after: 3 days Notes: svn path=/head/; revision=171302
* Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long2007-06-172-2/+2
| | | | | | | | | | now takes a device_t to be the parent of the bus that is being created. Most SIMs have been updated with a reasonable argument, but a few exceptions just pass NULL for now. This argument isn't used yet and the newbus integration likely won't be ready until after 7.0-RELEASE. Notes: svn path=/head/; revision=170872
* - Lock sbp_write_cmd() and ORB_POINTER_ACTIVE flag.Hidetoshi Shimokawa2007-06-161-11/+41
| | | | | | | | | | - Remove unnecessary timestamps. - Return CAM_RESRC_UNAVAIL for ORB shortage. - Fix a lock problem when doorbell is used. - Fix a potential bug for unordered execution. Notes: svn path=/head/; revision=170807
* - Suppress compiler optimization so that orb[1] must be written first.Hidetoshi Shimokawa2007-06-141-2/+7
| | | | | | | | | We may need an explicit memory barrier for other architectures other than i386/amd64. MFC after: 3 days Notes: svn path=/head/; revision=170724
* Timestamp after sent.Hidetoshi Shimokawa2007-06-082-4/+4
| | | | Notes: svn path=/head/; revision=170427
* Fix a race after a bus reset.Hidetoshi Shimokawa2007-06-082-14/+16
| | | | | | | | - We are in FWBUSINIT state just after SID interrupt. - Do not pass normal xfers before bus probe is done. Notes: svn path=/head/; revision=170425